List of usage examples for org.eclipse.jface.viewers IDecoration TOP_RIGHT
int TOP_RIGHT
To view the source code for org.eclipse.jface.viewers IDecoration TOP_RIGHT.
Click Source Link
From source file:org.talend.dataprofiler.core.ImageLib.java
License:Open Source License
/** * DOC qiongli Comment method "createAddedIcon". * /*w w w.j av a2 s. co m*/ * @param originalImg * @return * @deprecated use createAddedIcon(String originalImgName) and avoid to create image ervery time. */ @Deprecated public static ImageDescriptor createAddedIcon(ImageDescriptor originalImg) { ImageDescriptor addImg = getImageDescriptor(ICON_ADD_VAR); return originalImg != null ? new DecorationOverlayIcon(originalImg.createImage(), addImg, IDecoration.TOP_RIGHT) : null; }
From source file:org.talend.dataquality.record.linkage.ui.composite.utils.ImageLib.java
License:Open Source License
/** * DOC qiongli Comment method "createAddedIcon". * /*from w ww .j a v a 2 s.c om*/ * @param originalImg * @return */ public static ImageDescriptor createAddedIcon(ImageDescriptor originalImg) { ImageDescriptor addImg = getImageDescriptor(ICON_ADD_VAR); return originalImg != null ? new DecorationOverlayIcon(originalImg.createImage(), addImg, IDecoration.TOP_RIGHT) : null; }
From source file:org.talend.mdm.repository.ui.navigator.MDMServerDecorator.java
License:Open Source License
private void decorateRepositoryObject(Item item, IDecoration decoration) { if (item != null) { String version = item.getProperty().getVersion(); if (item instanceof WSResourceItem) { // resource image show catalog WSResourceItem ritem = (WSResourceItem) item; String imageCatalog = ritem.getResource().getImageCatalog(); if (imageCatalog != null) { decoration.addSuffix(" " + imageCatalog); //$NON-NLS-1$ }/*ww w .j a va 2s . co m*/ } else if (version != null) { decoration.addSuffix(" " + version); //$NON-NLS-1$ } MDMServerDef serverDef = RepositoryResourceUtil.getLastServerDef(item); if (serverDef != null) { decoration.addOverlay(IMG_SERVER, IDecoration.TOP_RIGHT); decoration.addSuffix(" " + serverDef.getName()); //$NON-NLS-1$ } } }
From source file:tinyos.dlrc.properties.source.SourceFolderDecorator.java
License:Open Source License
public void decorate(Object element, IDecoration decoration) { if (element instanceof IAdaptable) { IFolder folder = (IFolder) ((IAdaptable) element).getAdapter(IFolder.class); if (folder != null) { IProject project = folder.getProject(); try { if (project.hasNature(TinyOSCore.NATURE_ID)) { TinyOSPlugin plugin = TinyOSPlugin.getDefault(); if (plugin != null) { NesCPath path = plugin.getPaths(project); IFolder[] folders = path.getSourceFolders(); for (IFolder check : folders) { if (check.equals(folder)) { decoration.addOverlay(image, IDecoration.TOP_RIGHT); return; }/* ww w . jav a 2 s . c o m*/ } } } } catch (CoreException ex) { // swallow, it is not *that* important that the icons are correct... } } } }
From source file:ts.eclipse.ide.internal.ui.navigator.BuildpathIndicatorLabelDecorator.java
License:Open Source License
@Override public void decorate(Object element, IDecoration decoration) { ImageDescriptor overlay = getOverlay(element); if (overlay != null) { decoration.addOverlay(overlay, IDecoration.TOP_RIGHT); }//from w w w . j a va2s .c o m }
From source file:unc.lib.cdr.workbench.views.OriginalAndDivDecorator.java
License:Apache License
@Override public void decorate(Object element, IDecoration decoration) { if (element instanceof OriginalStub) { decorateOriginalStub((OriginalStub) element, decoration); return;//from ww w. java2 s . com } OriginalFileStore r = null; boolean isDiv = false; boolean isFile = false; // added/captured, queued/staged BR List<String> labels = new ArrayList<String>(); if (element instanceof OriginalFileStore) { r = (OriginalFileStore) element; if (r.isAttached()) { IFileInfo info = r.fetchInfo(); if (info.exists() && !info.isDirectory()) isFile = true; } // add prefix of "../" to these when not under volume root if (r.getWrapped().getParent() != null) { if (r.getOriginalStub().getStores().contains(r)) { if (!r.getOriginalStub().getVolumeRootStore().getWrapped().equals(r.getWrapped().getParent())) { decoration.addPrefix(".../"); } } } } else if (DivTypeImpl.class.isInstance(element)) { isDiv = true; DivType d = (DivType) element; if (METSConstants.Div_File.equals(d.getTYPE())) { isFile = true; } Object adapted = Platform.getAdapterManager().getAdapter(d, OriginalFileStore.class); if (adapted != null && adapted instanceof OriginalFileStore) { r = (OriginalFileStore) adapted; } // Descriptions Decor boolean hasUserEdited = false; boolean hasCrosswalked = false; for (MdSecType md : d.getDmdSec()) { String st = md.getSTATUS(); if (METSConstants.MD_STATUS_CROSSWALK_LINKED.equals(st) || METSConstants.MD_STATUS_CROSSWALK_USER_LINKED.equals(st)) { hasCrosswalked = true; } else if (METSConstants.MD_STATUS_USER_EDITED.equals(st)) { hasUserEdited = true; } } if (hasUserEdited) { decoration.addOverlay(Icon.UserEditedDecor.getImageDescriptor(), IDecoration.TOP_RIGHT); } else if (hasCrosswalked) { decoration.addOverlay(Icon.CrosswalkedDecor.getImageDescriptor(), IDecoration.TOP_RIGHT); } // ACL Decor boolean hasCrosswalkedACL = false; boolean hasUserACL = false; for (MdSecType md : d.getMdSec()) { if (MetsPackage.eINSTANCE.getAmdSecType_RightsMD().equals(md.eContainingFeature())) { String st = md.getSTATUS(); if (METSConstants.MD_STATUS_CROSSWALK_LINKED.equals(st) || METSConstants.MD_STATUS_CROSSWALK_USER_LINKED.equals(st)) { hasCrosswalkedACL = true; } else if (METSConstants.MD_STATUS_USER_EDITED.equals(st)) { hasUserACL = true; } } } if (hasUserACL) { decoration.addOverlay(Icon.ACLDecor.getImageDescriptor(), IDecoration.TOP_LEFT); } else if (hasCrosswalkedACL) { decoration.addOverlay(Icon.ACLGrayDecor.getImageDescriptor(), IDecoration.TOP_LEFT); } // add labels for links of which this div is the object for (SmLinkType sml : METSUtils.getObjectLinks(d)) { labels.add(METSConstants.getLinkForArcRole(sml.getArcrole()).label); } } ImageDescriptor overlay = null; if (r != null && r.getProject() != null && r.getProject().isOpen()) { boolean captured = false; if (r.isAttached() && isFile) { long byteLength = r.fetchInfo().getLength(); labels.add(IResourceConstants.humanReadableByteCount(byteLength, true)); } if (r.getMetsDivType() != null) { captured = true; if (!isDiv) { labels.add("captured"); } } // staged location == original location SharedStagingArea prestage = StagingPlugin.getDefault().getStages() .findMatchingArea(r.getWrapped().toURI()); if (prestage != null && r.getStagingLocatorType() == null) { labels.add("pre-staged: " + prestage.getName()); } if (r.getStagingLocatorType() != null) { // captured file (original or the div) overlay = Icon.StagedDecor.getImageDescriptor(); URI uri = URI.create(r.getStagingLocatorType().getHref()); if (uri.isAbsolute()) { labels.add("staged"); } else { labels.add("locally staged"); } } else { if (captured && isFile) { overlay = Icon.CaptureDecor.getImageDescriptor(); labels.add("queued"); } } } else { if (isDiv) { labels.add("added"); } } if (overlay != null) { decoration.addOverlay(overlay, IDecoration.BOTTOM_RIGHT); } StringBuilder sb = new StringBuilder(); if (labels.size() > 0) { sb.append(" ["); sb.append(labels.remove(0)); for (String label : labels) { sb.append(" ").append(label); } sb.append("]"); } decoration.addSuffix(sb.toString()); }
From source file:unc.lib.cdr.workbench.views.OriginalAndDivDecorator.java
License:Apache License
private void decorateOriginalStub(OriginalStub stub, IDecoration decoration) { decoration.addPrefix("Originals on "); List<String> labels = new ArrayList<String>(); // ejected overlay for detached disks if (!stub.isAttached()) { decoration.addOverlay(Icon.EjectedDecore.getImageDescriptor(), IDecoration.TOP_RIGHT); labels.add("ejected"); }//from w ww . j av a 2 s .c o m labels.add(stub.getVolumeType()); if (labels.size() > 0) { // decoration.setForegroundColor(org.eclipse.swt.graphics.); StringBuilder sb = new StringBuilder(); sb.append(" ["); sb.append(labels.remove(0)); for (String label : labels) { sb.append(" ").append(label); } sb.append("]"); decoration.addSuffix(sb.toString()); } }