List of usage examples for org.eclipse.jface.viewers IBasicPropertyConstants P_IMAGE
String P_IMAGE
To view the source code for org.eclipse.jface.viewers IBasicPropertyConstants P_IMAGE.
Click Source Link
"org.eclipse.jface.image") for an element's label image. From source file:com.redhat.ceylon.eclipse.code.explorer.PackageExplorerContentProvider.java
License:Open Source License
/** * Updates the package icon/*ww w.ja va 2 s .com*/ * @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 }); } }); }
From source file:descent.internal.ui.packageview.PackageExplorerContentProvider.java
License:Open Source License
/** * Updates the package icon//from w ww . j a v a 2 s.c o m */ private void postUpdateIcon(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 }); } }); }
From source file:ext.org.eclipse.jdt.internal.ui.browsing.JavaBrowsingContentProvider.java
License:Open Source License
/** * Updates the package icon//from w w w .j a va 2 s . c o m */ 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 }); } }); }
From source file:ext.org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.java
License:Open Source License
protected void doTypeHierarchyChangedOnViewers(IType[] changedTypes) { if (fHierarchyLifeCycle.getHierarchy() == null || !fHierarchyLifeCycle.getHierarchy().exists()) { clearInput();/*from ww w . ja va2 s .co m*/ } else { if (changedTypes == null) { // hierarchy change try { fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(fInputElements, getSite().getWorkbenchWindow()); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getSite().getShell(), TypeHierarchyMessages.TypeHierarchyViewPart_exception_title, TypeHierarchyMessages.TypeHierarchyViewPart_exception_message); clearInput(); return; } catch (InterruptedException e) { return; } fMethodsViewer.refresh(); updateHierarchyViewer(false); } else { // elements in hierarchy modified Object methodViewerInput = fMethodsViewer.getInput(); fMethodsViewer.refresh(); fMethodViewerPaneLabel.setText(fPaneLabelProvider.getText(methodViewerInput)); fMethodViewerPaneLabel.setImage(fPaneLabelProvider.getImage(methodViewerInput)); if (getCurrentViewer().isMethodFiltering()) { if (changedTypes.length == 1) { getCurrentViewer().refresh(changedTypes[0]); } else { updateHierarchyViewer(false); } } else { getCurrentViewer().update(changedTypes, new String[] { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE }); } } } }
From source file:nexcore.tool.uml.ui.core.util.ProjectUtil.java
License:Open Source License
/** * updateParentInExplorer/*from w ww .j av a 2 s. c o m*/ * * @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); }
From source file:nexcore.tool.uml.ui.core.util.ProjectUtil.java
License:Open Source License
/** * updateExplorer/*from www . j a v a 2s . co m*/ * * @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); } }
From source file:org.ebayopensource.vjet.eclipse.internal.ui.typehierarchy.VJOTypeHierarchyViewPart.java
License:Open Source License
protected void doTypeHierarchyChangedOnViewers(IType[] changedTypes) { if (fHierarchyLifeCycle.getHierarchy() == null || (!fHierarchyLifeCycle.getHierarchy().exists()) // add by patrick || (!fInputElement.getResource().isAccessible())) { // end add clearInput();//from www . jav a 2 s . c om } else { if (changedTypes == null) { // hierarchy change try { fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(fInputElement, getSite().getWorkbenchWindow()); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getSite().getShell(), TypeHierarchyMessages.TypeHierarchyViewPart_exception_title, TypeHierarchyMessages.TypeHierarchyViewPart_exception_message); clearInput(); return; } catch (InterruptedException e) { return; } fMethodsViewer.refresh(); updateHierarchyViewer(false); } else { // elements in hierarchy modified Object methodViewerInput = fMethodsViewer.getInput(); fMethodsViewer.refresh(); fMethodViewerPaneLabel.setText(fPaneLabelProvider.getText(methodViewerInput)); fMethodViewerPaneLabel.setImage(fPaneLabelProvider.getImage(methodViewerInput)); if (getCurrentViewer().isMethodFiltering()) { if (changedTypes.length == 1) { getCurrentViewer().refresh(changedTypes[0]); } else { updateHierarchyViewer(false); } } else { getCurrentViewer().update(changedTypes, new String[] { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE }); } } } }
From source file:org.eclipse.debug.internal.ui.views.memory.MemoryViewTab.java
License:Open Source License
public void propertyChange(final PropertyChangeEvent event) { // make sure this runs on the UI thread, otherwise, it // will get to a swt exception WorkbenchJob job = new WorkbenchJob("MemoryViewTab PropertyChanged") { //$NON-NLS-1$ public IStatus runInUIThread(IProgressMonitor monitor) { if (isDisposed()) return Status.OK_STATUS; if (event.getSource() == fRendering) { if (event.getProperty().equals(IBasicPropertyConstants.P_TEXT)) { Object value = event.getNewValue(); if (value != null && value instanceof String) { String label = (String) value; setTabLabel(label); } else { setTabLabel(fRendering.getLabel()); }/*from w ww. j ava2s.c o m*/ } if (event.getProperty().equals(IBasicPropertyConstants.P_IMAGE)) { Object value = event.getNewValue(); if (value != null && value instanceof Image) { Image image = (Image) value; fTabItem.setImage(image); } else { fTabItem.setImage(fRendering.getImage()); } } } return Status.OK_STATUS; } }; job.setSystem(true); job.schedule(); }
From source file:org.eclipse.dltk.internal.ui.navigator.ScriptExplorerContentProvider.java
License:Open Source License
/** * Updates the package icon/*from w w w . jav a 2 s . c o m*/ * * @param element * the element to update * @param runnables * the resulting view changes as runnables (type {@link Runnable} * ) */ private void postUpdateIcon(final IModelElement element, final 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 }); } }); }
From source file:org.eclipse.dltk.internal.ui.typehierarchy.TypeHierarchyViewPart.java
License:Open Source License
protected void doTypeHierarchyChangedOnViewers(IType[] changedTypes) { if (fHierarchyLifeCycle.getHierarchy() == null || !fHierarchyLifeCycle.getHierarchy().exists()) { clearInput();/*ww w . ja v a 2s . c o m*/ } else { if (changedTypes == null) { // hierarchy change try { fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(fInputElement, getSite().getWorkbenchWindow()); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getSite().getShell(), TypeHierarchyMessages.TypeHierarchyViewPart_exception_title, TypeHierarchyMessages.TypeHierarchyViewPart_exception_message); clearInput(); return; } catch (InterruptedException e) { return; } fMethodsViewer.refresh(); updateHierarchyViewer(false); } else { // elements in hierarchy modified Object methodViewerInput = fMethodsViewer.getInput(); fMethodsViewer.refresh(); fMethodViewerPaneLabel.setText(fPaneLabelProvider.getText(methodViewerInput)); fMethodViewerPaneLabel.setImage(fPaneLabelProvider.getImage(methodViewerInput)); if (getCurrentViewer().isMethodFiltering()) { if (changedTypes.length == 1) { getCurrentViewer().refresh(changedTypes[0]); } else { updateHierarchyViewer(false); } } else { getCurrentViewer().update(changedTypes, new String[] { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE }); } } } }