/** * updateParentInExplorer * * @param target void */ public static void updateParentInExplorer(EObject target) { if (null == target) { return; } CommonViewer commonViewer = ViewerRegistry.getViewer(); if (commonViewer.getControl().isDisposed()) { return; } if (target instanceof DynamicEObjectImpl) { target = UMLUtil.getBaseElement(target); } ITreeNode targetNode = null; EObject parent = UMLManager.getParent((Element) target); targetNode = UMLTreeNodeRegistry.getTreeNode(parent); String[] flags = null; flags = new String[] { IBasicPropertyConstants.P_IMAGE, IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_CHILDREN }; commonViewer.update(targetNode, flags); }
/** * updateExplorer * * @param target * @param childIncluded void */ public static void updateExplorer(EObject target, boolean childIncluded) { if (null == target) { return; } if (target instanceof EAnnotation) { return; } CommonViewer commonViewer = ViewerRegistry.getViewer(); if (commonViewer.getControl().isDisposed()) { return; } if (target instanceof DynamicEObjectImpl) { target = UMLUtil.getBaseElement(target); } ITreeNode targetNode = null; targetNode = UMLTreeNodeRegistry.getTreeNode(target); if (null == targetNode) { return; } String[] flags = null; if (childIncluded) { flags = new String[] { IBasicPropertyConstants.P_IMAGE, IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_CHILDREN }; } else { flags = new String[] { IBasicPropertyConstants.P_IMAGE, IBasicPropertyConstants.P_TEXT }; } try { commonViewer.update(targetNode, flags); commonViewer.refresh(targetNode); } catch (Exception ex) { Log.error(ex); } }
private void updatePackageIcon(final IJavaElement element) { postRunnable(new Runnable() { public void run() { // 1GF87WR: ITPUI:ALL - SWTEx + NPE closing a workbench window. Control ctrl= fViewer.getControl(); if (ctrl != null && !ctrl.isDisposed()) fViewer.update(element, new String[]{IBasicPropertyConstants.P_IMAGE}); } }); }
/** * Updates the package icon * @param element the element to update * @param runnables the resulting view changes as runnables (type {@link Runnable}) */ private void postUpdateIcon(final IJavaElement element, Collection<Runnable> runnables) { runnables.add(new Runnable() { public void run() { // 1GF87WR: ITPUI:ALL - SWTEx + NPE closing a workbench window. fViewer.update(element, new String[]{IBasicPropertyConstants.P_IMAGE}); } }); }
/** * Updates the package icon */ private void postUpdateIcon(final IJavaElement element) { postRunnable(new Runnable() { public void run() { Control ctrl= fViewer.getControl(); if (ctrl != null && !ctrl.isDisposed()) fViewer.update(element, new String[]{IBasicPropertyConstants.P_IMAGE}); } }); }
public Object getPropertyValue(Object name) { if (name.equals(IBasicPropertyConstants.P_TEXT)) { return fSource.getElementName(); } return null; }
/** * Return true if this sorter is affected by a property change of * propertyName on the specified element. */ @Override public boolean isSorterProperty(final Object object, final String propertyId) { return propertyId.equals(IBasicPropertyConstants.P_TEXT); }