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

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

Introduction

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

Prototype

void addOverlay(ImageDescriptor overlay);

Source Link

Document

Adds an overlay to the element's image.

Usage

From source file:org.eclipse.epf.authoring.ui.providers.MethodElementLightweightLabelDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    try {//from ww w.  ja  v  a 2  s  .  c  o m
        if (LibraryValidationMarkerHelper.isInvalid(element)
        //               || MethodRichTextMarkerHelper.isInvalid(element)
        ) {
            decoration.addOverlay(getErrorOverlay());
        }
    } catch (Exception e) {
        AuthoringUIPlugin.getDefault().getLogger().logError(e);
    }
    LibraryView libaryView = LibraryView.getViewInstance();
    LibraryViewExtender extender = libaryView == null ? null : libaryView.getExtender();
    if (extender != null) {
        extender.decorate(element, decoration);
    }
}

From source file:org.eclipse.epf.authoring.ui.providers.ProblemsLabelDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    int adornmentFlags = computeAdornmentFlags(element);
    if (adornmentFlags == ERRORTICK_ERROR) {
        decoration.addOverlay(AuthoringUIImages.IMG_DESC_OVR_ERROR);
    }/*from  w  ww .  ja va 2  s.com*/
}

From source file:org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    int adornmentFlags = computeAdornmentFlags(element);
    if ((adornmentFlags & JavaElementImageDescriptor.IMPLEMENTS) != 0) {
        if ((adornmentFlags & JavaElementImageDescriptor.SYNCHRONIZED) != 0) {
            decoration.addOverlay(JavaPluginImages.DESC_OVR_SYNCH_AND_IMPLEMENTS);
        } else {/*from w  w w  .j a  v  a 2s. com*/
            decoration.addOverlay(JavaPluginImages.DESC_OVR_IMPLEMENTS);
        }
    } else if ((adornmentFlags & JavaElementImageDescriptor.OVERRIDES) != 0) {
        if ((adornmentFlags & JavaElementImageDescriptor.SYNCHRONIZED) != 0) {
            decoration.addOverlay(JavaPluginImages.DESC_OVR_SYNCH_AND_OVERRIDES);
        } else {
            decoration.addOverlay(JavaPluginImages.DESC_OVR_OVERRIDES);
        }
    }
}

From source file:org.eclipse.jdt.ui.ProblemsLabelDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    int adornmentFlags = computeAdornmentFlags(element);
    if (adornmentFlags == ERRORTICK_ERROR) {
        decoration.addOverlay(JavaPluginImages.DESC_OVR_ERROR);
    } else if (adornmentFlags == ERRORTICK_BUILDPATH_ERROR) {
        decoration.addOverlay(JavaPluginImages.DESC_OVR_BUILDPATH_ERROR);
    } else if (adornmentFlags == ERRORTICK_WARNING) {
        decoration.addOverlay(JavaPluginImages.DESC_OVR_WARNING);
    }// w  w w.  j  av  a  2  s  .com
}

From source file:org.eclipse.jst.j2ee.internal.ui.util.AnnotationIconDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    EObject eObject = null;//from  w ww  .j av a  2  s.c  o  m
    if (element instanceof BeanClassProviderHelper) {
        BeanClassProviderHelper beanClassHelper = (BeanClassProviderHelper) element;
        eObject = beanClassHelper.getEjb();
    } else if (element instanceof EnterpriseBean || element instanceof Servlet)
        eObject = (EObject) element;
    if (eObject == null)
        return;
    if (isAnnotatedSupported(eObject)) {
        if (isAnnotationEnabled(eObject)) {
            if (ANNOTATION_IMG_DESC != null)
                decoration.addOverlay(ANNOTATION_IMG_DESC);
        } else {
            if (ANNOTATION_DISABLED_IMG_DESC != null)
                decoration.addOverlay(ANNOTATION_DISABLED_IMG_DESC);
        }
    }
}

From source file:org.eclipse.jst.j2ee.navigator.internal.J2EEProjectDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    IProject project = null;// w ww. j  a  va  2 s  .  c  om
    if (element instanceof IProject) {
        project = (IProject) element;
    } else if (element instanceof IJavaProject) {
        project = ((IJavaProject) element).getProject();
    }
    if (project != null) {
        ImageDescriptor overlay = null;
        if (hasFacet(project, EAR_FACET))
            overlay = getEAR();
        else if (hasFacet(project, APPCLIENT_FACET))
            overlay = getAPPCLIENT();
        else if (hasFacet(project, WEB_FACET))
            overlay = getDYNAMICWEB();
        else if (hasFacet(project, EJB_FACET))
            overlay = getEJB();
        else if (hasFacet(project, CONNECTOR_FACET))
            overlay = getCONNECTOR();
        else if (hasFacet(project, STATIC_WEB_FACET))
            overlay = getDYNAMICWEB();
        else if (hasFacet(project, WEB_FRAGMENT_FACET))
            overlay = getWEBFRAGMENT();

        // keep it null for if (hasFacet(project, UTILITY_FACET))
        if (overlay != null)
            decoration.addOverlay(overlay);
    }
}

From source file:org.eclipse.jst.jee.ui.internal.navigator.ejb.BeanDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    if (element instanceof BeanInterfaceNode) {
        BeanInterfaceNode beanInteraceNode = (BeanInterfaceNode) element;
        switch (beanInteraceNode.getKind()) {
        case BeanInterfaceNode.KINDS.BUSSINESS_LOCAL:
            applyDecorator(JEEUIPluginIcons.BUSSINESS_LOCAL, decoration);
            break;
        case BeanInterfaceNode.KINDS.BUSSINESS_REMOTE:
            applyDecorator(JEEUIPluginIcons.BUSSINESS_REMOTE, decoration);
            break;
        case BeanInterfaceNode.KINDS.REMOTE:
            applyDecorator(JEEUIPluginIcons.REMOTE, decoration);
            break;
        case BeanInterfaceNode.KINDS.REMOTE_HOME:
            applyDecorator(JEEUIPluginIcons.REMOTE_HOME, decoration);
            break;
        case BeanInterfaceNode.KINDS.LOCAL:
            applyDecorator(JEEUIPluginIcons.LOCAL, decoration);
            break;
        case BeanInterfaceNode.KINDS.LOCAL_HOME:
            applyDecorator(JEEUIPluginIcons.LOCAL_HOME, decoration);
            break;
        }/*from w  ww .  j a  va  2  s . com*/
    } else if (element instanceof BeanNode) {
        decoration.addOverlay(J2EEUIPlugin.getDefault().getImageDescriptor("ejb_module_ovr")); //$NON-NLS-1$
    }
}

From source file:org.eclipse.jst.jee.ui.internal.navigator.ejb.BeanDecorator.java

License:Open Source License

private void applyDecorator(String id, IDecoration decoration) {
    ImageDescriptor imageDescriptor = JEEUIPlugin.getDefault().getImageDescriptor(id);
    decoration.addOverlay(imageDescriptor);

}

From source file:org.eclipse.jubula.client.alm.mylyn.ui.decorator.TaskDecorator.java

License:Open Source License

/** {@inheritDoc} */
public void decorate(Object element, IDecoration decoration) {
    boolean hasTaskId = false;

    if (element instanceof INodePO) {
        hasTaskId = NodePropertyTester.hasTaskIdSet((INodePO) element);
    } else if (element instanceof TestResultNode) {
        hasTaskId = StringUtils.isNotBlank(((TestResultNode) element).getTaskId());
    }//  www .j  a v  a2 s  . c o m

    if (hasTaskId) {
        decoration.addOverlay(TasksUiImages.TASK_REMOTE);
    }
}

From source file:org.eclipse.jubula.client.ui.provider.labelprovider.decorators.TestResultParametersDecorator.java

License:Open Source License

/** {@inheritDoc} */
public void decorate(Object element, IDecoration decoration) {
    if (element instanceof TestResultNode) {
        TestResultNode testResult = (TestResultNode) element;
        decoration.addSuffix(testResult.getParameterDescription());
        if (StringUtils.isNotBlank(testResult.getCommandLog())) {
            decoration.addOverlay(IconConstants.COMMANDLOG_IMAGE_DESCRIPTOR);
        }/* w ww .jav  a  2  s .c  om*/
    }
}