List of usage examples for org.eclipse.jface.viewers IDecoration addOverlay
void addOverlay(ImageDescriptor overlay, int quadrant);
From source file:com.teamunify.eclipse.mylyn.pt.ui.PtTaskListLabelDecorator.java
License:Open Source License
public void decorate(Object element, IDecoration decoration) { if (element instanceof ITask) { ITask task = (ITask) element;/* w w w . j ava 2s .com*/ String kind = task.getTaskKind(); if (kind.equalsIgnoreCase("bug")) { ImageDescriptor imageDescriptor = null; try { imageDescriptor = ImageDescriptor.createFromURL(getImageURL("bug.png")); decoration.addOverlay(imageDescriptor, IDecoration.BOTTOM_RIGHT); } catch (Exception e) { e.printStackTrace(); } } } }
From source file:de.fu_berlin.inf.dpp.ui.decorators.SharedProjectDecorator.java
License:Open Source License
@Override public void decorate(Object element, IDecoration decoration) { // make a copy as this value might change while decorating ISarosSession currentSession = session; if (currentSession == null) return;/*from w w w .j a va2 s.com*/ IResource resource = (IResource) element; if (!currentSession.isShared(ResourceAdapterFactory.create(resource))) return; decoration.addOverlay(SharedProjectDecorator.PROJECT_DESCRIPTOR, IDecoration.TOP_LEFT); if (resource.getType() == IResource.PROJECT) { boolean isCompletelyShared = currentSession .isCompletelyShared(ResourceAdapterFactory.create(resource.getProject())); decoration.addSuffix(isCompletelyShared ? Messages.SharedProjectDecorator_shared : Messages.SharedProjectDecorator_shared_partial); } }
From source file:de.fu_berlin.inf.dpp.ui.decorators.SharedProjectFileDecorator.java
License:Open Source License
@Override public void decorate(Object element, IDecoration decoration) { ImageDescriptor imageDescriptor = resourceToImageMapping.get(element); if (imageDescriptor == null) return;//ww w . j a v a 2s . com decoration.addOverlay(imageDescriptor, IDecoration.TOP_RIGHT); }
From source file:de.jcup.egradle.eclipse.decorators.EGradleProjectDecorator.java
License:Apache License
@Override public void decorate(Object element, IDecoration decoration) { /* no decoration when plugin is not running */ if (Activator.getDefault() == null) { return;/* w ww . ja v a 2 s.c o m*/ } /* no decoration when workbench is not running */ if (!PlatformUI.isWorkbenchRunning()) { return; } /* do not decoratore if its not a project */ if (!(element instanceof IProject)) { return; } IProject p = (IProject) element; File rootFolder = EGradleUtil.getRootProjectFolderWithoutErrorHandling(); if (rootFolder == null) { return; } if (EGradleUtil.hasVirtualRootProjectNature(p)) { decoration.addPrefix("EGradle "); decoration.addSuffix(" (" + rootFolder.getName() + ")"); decorateImage(decoration); /* Because the virtual root project is not hosted in SCM - at least with GIT, there is always an * ugly question icon at IDecoration.BOTTOM_RIGHT . To avoid this * we simply render an empty deocorator here. This is okay, because diff * changes in project are rendered as usual */ decoration.addOverlay(emptyDecoratorDescriptor, IDecoration.BOTTOM_RIGHT); return; } /* we simply check if the project is inside root project */ try { if (!isSubprojectOfCurrentRootProject(p)) { return; } if (EGradleUtil.getPreferences().isSubProjectIconDecorationEnabled()) { decorateImage(decoration); } } catch (CoreException e) { EGradleUtil.log(e); } }
From source file:de.jcup.egradle.eclipse.decorators.EGradleProjectDecorator.java
License:Apache License
private void decorateImage(IDecoration decoration) { // TOP_LEFT decoration.addOverlay(egradleProjectDescriptor, IDecoration.TOP_LEFT); }
From source file:de.jcup.egradle.eclipse.ide.decorators.EGradleProjectDecorator.java
License:Apache License
@Override public void decorate(Object element, IDecoration decoration) { /* no decoration when plugin is not running */ if (IDEActivator.getDefault() == null) { return;//from w ww . ja va 2 s.c om } /* no decoration when workbench is not running */ if (!PlatformUI.isWorkbenchRunning()) { return; } /* do not decoratore if its not a project */ if (!(element instanceof IProject)) { return; } IProject p = (IProject) element; File rootFolder = getRootProjectFolderWithoutErrorHandling(); if (rootFolder == null) { return; } if (hasVirtualRootProjectNature(p)) { decoration.addPrefix("EGradle "); decoration.addSuffix(" (" + rootFolder.getName() + ")"); decorateImage(decoration); /* * Because the virtual root project is not hosted in SCM - at least * with GIT, there is always an ugly question icon at * IDecoration.BOTTOM_RIGHT . To avoid this we simply render an * empty deocorator here. This is okay, because diff changes in * project are rendered as usual */ decoration.addOverlay(emptyDecoratorDescriptor, IDecoration.BOTTOM_RIGHT); return; } /* we simply check if the project is inside root project */ try { if (!isSubprojectOfCurrentRootProject(p)) { return; } if (IDEUtil.getPreferences().isSubProjectIconDecorationEnabled()) { decorateImage(decoration); } } catch (CoreException e) { IDEUtil.logError("Was not able to decorate sub project:" + p, e); } }
From source file:de.ovgu.featureide.ui.decorators.ActiveConfigurationDecorator.java
License:Open Source License
public void decorate(Object element, IDecoration decoration) { IFeatureProject pd = CorePlugin.getFeatureProject((IResource) element); if (pd != null && ((IResource) element).equals(pd.getCurrentConfiguration())) { decoration.addOverlay(icon, IDecoration.TOP_LEFT); }/*from w w w .j a v a 2s.c o m*/ }
From source file:de.ovgu.featureide.ui.decorators.FeatureFolderDecorator.java
License:Open Source License
public void decorate(Object element, IDecoration decoration) { IFolder folder = (IFolder) element;//from www . j av a 2 s . c o m //decorate only files in our projects IFeatureProject featureProject = CorePlugin.getFeatureProject(folder); if (featureProject == null || featureProject.getSourceFolder() == null || !featureProject.getSourceFolder().equals(folder.getParent())) return; //handle only not-in-use folders if (featureProject.getFeatureModel().containsLayer(folder.getName())) return; //decorate non-empty not-in-use folders decoration.addOverlay(OVERLAY, IDecoration.TOP_LEFT); }
From source file:de.ovgu.featureide.ui.decorators.FeatureProjectDecorator.java
License:Open Source License
public void decorate(Object element, IDecoration decoration) { IProject project = (IProject) element; //decorate feature projects if (CorePlugin.hasProjectData(project)) { decoration.addOverlay(OVERLAY, IDecoration.TOP_LEFT); }/* ww w . j av a 2s . c om*/ }
From source file:de.ovgu.featureide.ui.mpl.InterfaceProjectDecorator.java
License:Open Source License
@Override public void decorate(Object element, IDecoration decoration) { if (MPLPlugin.getDefault().isInterfaceProject((IProject) element)) { decoration.addOverlay(OVERLAY, IDecoration.TOP_LEFT); }//w w w . jav a 2s . c o m }