Example usage for org.eclipse.jface.viewers IDecoration BOTTOM_RIGHT

List of usage examples for org.eclipse.jface.viewers IDecoration BOTTOM_RIGHT

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers IDecoration BOTTOM_RIGHT.

Prototype

int BOTTOM_RIGHT

To view the source code for org.eclipse.jface.viewers IDecoration BOTTOM_RIGHT.

Click Source Link

Document

Constant for the bottom right quadrant.

Usage

From source file:gov.redhawk.ide.sdr.internal.ui.IdlLibraryDecorator.java

License:Open Source License

/**
 * {@inheritDoc}/*from w ww  .  jav a  2s  .  c o m*/
 */
@Override
public void decorate(final Object element, final IDecoration decoration) {
    if (element instanceof IdlLibrary) {
        final IdlLibrary library = (IdlLibrary) element;
        ScaModelCommand.execute(library, new ScaModelCommand() {

            @Override
            public void execute() {
                if (!library.eAdapters().contains(libraryListener)) {
                    library.eAdapters().add(libraryListener);
                }
            }
        });
        if (library.getLoadStatus() != null) {
            final ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
            final IStatus status = library.getLoadStatus();
            switch (status.getSeverity()) {
            case IStatus.WARNING:
                decoration.addOverlay(sharedImages.getImageDescriptor(ISharedImages.IMG_DEC_FIELD_WARNING),
                        IDecoration.BOTTOM_RIGHT);
                break;
            case IStatus.ERROR:
                decoration.addOverlay(sharedImages.getImageDescriptor(ISharedImages.IMG_DEC_FIELD_ERROR),
                        IDecoration.BOTTOM_RIGHT);
                break;
            default:
                break;
            }
        }
    }

}

From source file:gov.redhawk.ide.sdr.internal.ui.SdrRootDecorator.java

License:Open Source License

/**
 * {@inheritDoc}//from  w w w .ja va  2 s. c om
 */
@Override
public void decorate(final Object element, final IDecoration decoration) {
    if (element instanceof SdrRoot) {
        final SdrRoot sdrRoot = (SdrRoot) element;
        ScaModelCommand.execute(sdrRoot, new ScaModelCommand() {

            @Override
            public void execute() {
                if (!sdrRoot.eAdapters().contains(sdrRootListener)) {
                    sdrRoot.eAdapters().add(sdrRootListener);
                }
            }
        });
        if (sdrRoot.getLoadStatus() != null) {
            final ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
            final IStatus status = sdrRoot.getLoadStatus();
            if (status == null) {
                return;
            }
            switch (status.getSeverity()) {
            case IStatus.WARNING:
                decoration.addOverlay(sharedImages.getImageDescriptor(ISharedImages.IMG_DEC_FIELD_WARNING),
                        IDecoration.BOTTOM_RIGHT);
                break;
            case IStatus.ERROR:
                decoration.addOverlay(sharedImages.getImageDescriptor(ISharedImages.IMG_DEC_FIELD_ERROR),
                        IDecoration.BOTTOM_RIGHT);
                break;
            default:
                break;
            }
        }
    }

}

From source file:info.limpet.ui.decorators.LimpetDecorator.java

License:Open Source License

protected void decorateWrapper(CommandWrapper element, IDecoration decoration) {
    final ICommand<?> coll = element.getCommand();

    boolean in = coll.getInputs() != null && coll.getInputs().size() > 0;
    boolean out = coll.getOutputs() != null && coll.getOutputs().size() > 0;
    decorateInOut(decoration, in, out);//  w ww.  java  2  s.  c  om

    // also apply a decoration to indicate that the symbol is dynamically updating
    if (coll.getDynamic()) {
        decoration.addOverlay(DYNAMIC, IDecoration.BOTTOM_RIGHT);
    }
}

From source file:info.limpet.ui.decorators.LimpetDecorator.java

License:Open Source License

protected void decorateWrapper(CollectionWrapper element, IDecoration decoration) {
    final ICollection coll = element.getCollection();
    boolean out = coll.getPrecedent() != null;
    boolean in = coll.getDependents() != null && coll.getDependents().size() > 0;
    decorateInOut(decoration, in, out);/* w ww  .j a  va  2  s  . c o m*/

    if (coll.isTemporal()) {
        decoration.addOverlay(TIME, IDecoration.BOTTOM_RIGHT);
    }
    if (coll.getValuesCount() == 1) {
        decoration.addOverlay(SINGLE, IDecoration.BOTTOM_LEFT);
    }
}

From source file:it.intecs.pisa.develenv.ui.decorators.TOOLBOXProjectDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    /**//  www . j a  va 2  s .  co  m
     * Checks that the element is an IResource with the 'Read-only' attribute
     * and adds the decorator based on the specified image description and the
     * integer representation of the placement option.
     */

    if (isTBXProject(element)) {
        iconPath = getIconByType(element);
        if (iconPath != null) {
            IResource resource = (IResource) element;
            ResourceAttributes attrs = resource.getResourceAttributes();
            URL url = Platform.find(Platform.getBundle("com.intecs.ToolboxScript.ui"), new Path(iconPath)); //NON-NLS-1

            if (url == null)
                return;

            descriptor = ImageDescriptor.createFromURL(url);
            quadrant = IDecoration.BOTTOM_RIGHT;
            decoration.addOverlay(descriptor, quadrant);
        }

    }

}

From source file:libgdxplugin.decorators.ReadOnly.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    /**//from   w  w w  .j av a2s  .  c o  m
     * Checks that the element is an IResource with the 'Read-only' attribute
     * and adds the decorator based on the specified image description and the
     * integer representation of the placement option.
     */
    IResource resource = (IResource) element;
    ResourceAttributes attrs = resource.getResourceAttributes();
    if (attrs.isReadOnly()) {
        URL url = FileLocator.find(Platform.getBundle("LibgdxPlugin"), new Path(iconPath), null); //NON-NLS-1

        if (url == null)
            return;
        descriptor = ImageDescriptor.createFromURL(url);
        quadrant = IDecoration.BOTTOM_RIGHT;
        decoration.addOverlay(descriptor, quadrant);
    }
}

From source file:mm.eclipse.trac.views.TracLabelDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    if (element instanceof TracServer) {
        TracServer server = (TracServer) element;
        if (!server.isValid())
            decoration.addOverlay(Images.getDescriptor(Images.Error), IDecoration.TOP_LEFT);

    } else if (element instanceof WikiPage) {
        WikiPage page = (WikiPage) element;
        if (page.isDirty()) {
            decoration.addOverlay(Images.getDescriptor(Images.Modified), IDecoration.BOTTOM_RIGHT);
        }/*from   w ww .j av  a  2 s.  c  o  m*/
    }
}

From source file:net.sourceforge.taggerplugin.preferences.TaggerPreferencePage.java

License:Open Source License

/**
 * Creates the field editors. Field editors are abstractions of
 * the common GUI blocks needed to manipulate various types
 * of preferences. Each field editor knows how to save and
 * restore itself.//from   ww w .j a  v a 2 s  .  c  om
 */
public void createFieldEditors() {
    addField(new BooleanFieldEditor(PreferenceConstants.CONFIRM_CLEAR_ASSOCIATIONS.getKey(),
            TaggerMessages.TaggerPreferencePage_Label_ConfirmClear, getFieldEditorParent()));
    addField(new BooleanFieldEditor(PreferenceConstants.CONFIRM_DELETE_TAG.getKey(),
            TaggerMessages.TaggerPreferencePage_Label_ConfirmDelete, getFieldEditorParent()));

    addField(new RadioGroupFieldEditor(PreferenceConstants.POSITION_LABEL_DECORATION.getKey(),
            TaggerMessages.TaggerPreferencePage_Label_LabelDecoration, 1,
            new String[][] {
                    { TaggerMessages.TaggerPreferencePage_Label_LabelDecoration_TopRight,
                            String.valueOf(IDecoration.TOP_RIGHT) },
                    { TaggerMessages.TaggerPreferencePage_Label_LabelDecoration_TopLeft,
                            String.valueOf(IDecoration.TOP_LEFT) },
                    { TaggerMessages.TaggerPreferencePage_Label_LabelDecoration_BottomRight,
                            String.valueOf(IDecoration.BOTTOM_RIGHT) },
                    { TaggerMessages.TaggerPreferencePage_Label_LabelDecoration_BottomLeft,
                            String.valueOf(IDecoration.BOTTOM_LEFT) } },
            getFieldEditorParent()));

    //       FIXME: externalize
    addField(new FileFieldEditor(PreferenceConstants.TAGSET_FILE_LOCATION.getKey(), "TagSet Storage File:",
            true, getFieldEditorParent()));
}

From source file:org.apache.directory.studio.ldapbrowser.ui.views.browser.BrowserViewLabelDecorator.java

License:Apache License

/**
 * {@inheritDoc}//  www  .j a  va 2s .  c  om
 */
public void decorate(Object element, IDecoration decoration) {
    IEntry entry = null;
    if (element instanceof ISearchResult) {
        entry = ((ISearchResult) element).getEntry();
        decoration.addOverlay(
                BrowserUIPlugin.getDefault().getImageDescriptor(BrowserUIConstants.IMG_OVR_SEARCHRESULT),
                IDecoration.BOTTOM_RIGHT);
    } else if (element instanceof IEntry) {
        entry = (IEntry) element;
        if (entry.getChildrenFilter() != null) {
            decoration.addOverlay(
                    BrowserUIPlugin.getDefault().getImageDescriptor(BrowserUIConstants.IMG_OVR_FILTERED),
                    IDecoration.BOTTOM_RIGHT);
        }
    }

    if (entry instanceof IContinuation || element instanceof IContinuation) {
        decoration.addOverlay(BrowserUIPlugin.getDefault().getImageDescriptor(BrowserUIConstants.IMG_OVR_REF),
                IDecoration.TOP_LEFT);
    }
}

From source file:org.apache.directory.studio.schemaeditor.view.SchemaEditorTypeLabelDecorator.java

License:Apache License

/**
 * {@inheritDoc}/*from w w w.  j  a  v  a2s. co  m*/
 */
public void decorate(Object element, IDecoration decoration) {
    if (element instanceof AttributeTypeWrapper) {
        UsageEnum usage = ((AttributeTypeWrapper) element).getAttributeType().getUsage();
        if (usage == UsageEnum.USER_APPLICATIONS) {
            decoration.addOverlay(
                    Activator.getDefault()
                            .getImageDescriptor(PluginConstants.IMG_ATTRIBUTE_TYPE_OVERLAY_USER_APPLICATION),
                    IDecoration.BOTTOM_RIGHT);
        } else if ((usage == UsageEnum.DIRECTORY_OPERATION) || (usage == UsageEnum.DISTRIBUTED_OPERATION)
                || (usage == UsageEnum.DSA_OPERATION)) {
            decoration.addOverlay(Activator.getDefault().getImageDescriptor(
                    PluginConstants.IMG_ATTRIBUTE_TYPE_OVERLAY_OPERATION), IDecoration.BOTTOM_RIGHT);
        }
    } else if (element instanceof ObjectClassWrapper) {
        ObjectClassTypeEnum classType = ((ObjectClassWrapper) element).getObjectClass().getType();
        if (classType == ObjectClassTypeEnum.ABSTRACT) {
            decoration.addOverlay(Activator.getDefault().getImageDescriptor(
                    PluginConstants.IMG_OBJECT_CLASS_OVERLAY_ABSTRACT), IDecoration.BOTTOM_RIGHT);
        } else if (classType == ObjectClassTypeEnum.STRUCTURAL) {
            decoration.addOverlay(Activator.getDefault().getImageDescriptor(
                    PluginConstants.IMG_OBJECT_CLASS_OVERLAY_STRUCTURAL), IDecoration.BOTTOM_RIGHT);
        } else if (classType == ObjectClassTypeEnum.AUXILIARY) {
            decoration.addOverlay(Activator.getDefault().getImageDescriptor(
                    PluginConstants.IMG_OBJECT_CLASS_OVERLAY_AUXILIARY), IDecoration.BOTTOM_RIGHT);
        }
    } else if (element instanceof AttributeType) {
        UsageEnum usage = ((AttributeType) element).getUsage();
        if (usage == UsageEnum.USER_APPLICATIONS) {
            decoration.addOverlay(
                    Activator.getDefault()
                            .getImageDescriptor(PluginConstants.IMG_ATTRIBUTE_TYPE_OVERLAY_USER_APPLICATION),
                    IDecoration.BOTTOM_RIGHT);
        } else if ((usage == UsageEnum.DIRECTORY_OPERATION) || (usage == UsageEnum.DISTRIBUTED_OPERATION)
                || (usage == UsageEnum.DSA_OPERATION)) {
            decoration.addOverlay(Activator.getDefault().getImageDescriptor(
                    PluginConstants.IMG_ATTRIBUTE_TYPE_OVERLAY_OPERATION), IDecoration.BOTTOM_RIGHT);
        }
    } else if (element instanceof ObjectClass) {
        ObjectClassTypeEnum classType = ((ObjectClass) element).getType();
        if (classType == ObjectClassTypeEnum.ABSTRACT) {
            decoration.addOverlay(Activator.getDefault().getImageDescriptor(
                    PluginConstants.IMG_OBJECT_CLASS_OVERLAY_ABSTRACT), IDecoration.BOTTOM_RIGHT);
        } else if (classType == ObjectClassTypeEnum.STRUCTURAL) {
            decoration.addOverlay(Activator.getDefault().getImageDescriptor(
                    PluginConstants.IMG_OBJECT_CLASS_OVERLAY_STRUCTURAL), IDecoration.BOTTOM_RIGHT);
        } else if (classType == ObjectClassTypeEnum.AUXILIARY) {
            decoration.addOverlay(Activator.getDefault().getImageDescriptor(
                    PluginConstants.IMG_OBJECT_CLASS_OVERLAY_AUXILIARY), IDecoration.BOTTOM_RIGHT);
        }
    }
}