Example usage for org.eclipse.jface.dialogs Dialog DLG_IMG_HELP

List of usage examples for org.eclipse.jface.dialogs Dialog DLG_IMG_HELP

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs Dialog DLG_IMG_HELP.

Prototype

String DLG_IMG_HELP

To view the source code for org.eclipse.jface.dialogs Dialog DLG_IMG_HELP.

Click Source Link

Document

Image registry key for help image (value "dialog_help_image").

Usage

From source file:org.eclipse.ui.ide.markers.compatibility.internal.MarkerColumnLabelProvider.java

License:Open Source License

public Image getImage(Object element) {

    // if (showAnnotations && element instanceof MarkerEntry) {
    // MarkerItem item = (MarkerItem) element;
    // IMarker marker = item.getMarker();
    // if (marker != null) {
    // String contextId = IDE.getMarkerHelpRegistry().getHelp(marker);
    ///*from  w  ww . ja  va2 s.co m*/
    // if (contextId != null)
    // return JFaceResources.getImage(Dialog.DLG_IMG_HELP);
    // }
    // }

    MarkerItem item = (MarkerItem) element;
    Image image = field.getImage(item);
    ImageDescriptor[] descriptors = new ImageDescriptor[5];
    if (showAnnotations && item.isConcrete()) {
        IMarker marker = item.getMarker();
        // If there is no image get the full image rather than the decorated
        // one
        if (marker != null) {
            String contextId = IDE.getMarkerHelpRegistry().getHelp(marker);
            if (contextId != null) {
                if (image == null)
                    image = JFaceResources.getImage(Dialog.DLG_IMG_HELP);
                else
                    descriptors[IDecoration.TOP_RIGHT] = IDEWorkbenchPlugin.getIDEImageDescriptor(
                            MarkerSupportInternalUtilities.IMG_MARKERS_HELP_DECORATION_PATH);
            }
            if (IDE.getMarkerHelpRegistry().hasResolutions(marker)) {
                if (image == null)
                    image = imageManager.createImage(IDEInternalWorkbenchImages
                            .getImageDescriptor(IDEInternalWorkbenchImages.IMG_ELCL_QUICK_FIX_ENABLED));
                else
                    descriptors[IDecoration.BOTTOM_RIGHT] = IDEWorkbenchPlugin.getIDEImageDescriptor(
                            MarkerSupportInternalUtilities.IMG_MARKERS_QUICK_FIX_DECORATION_PATH);
            }

            if (descriptors[IDecoration.TOP_RIGHT] != null || descriptors[IDecoration.BOTTOM_RIGHT] != null)
                image = imageManager.createImage(new DecorationOverlayIcon(image, descriptors));
        }
    }
    return image;
}

From source file:org.eclipse.ui.views.markers.MarkerField.java

License:Open Source License

/**
 * Annotate the image with indicators for whether or not help or quick fix
 * are available./*from ww w . j  a  v a  2 s . c o  m*/
 * 
 * @param item
 *            the item being decorated
 * @param image
 *            the image being overlaid
 * @return Image
 */
public Image annotateImage(MarkerItem item, Image image) {
    ImageDescriptor[] descriptors = new ImageDescriptor[5];
    if (item.getMarker() != null) {
        IMarker marker = item.getMarker();
        // If there is no image get the full image rather than the decorated
        // one
        if (marker != null) {
            String contextId = IDE.getMarkerHelpRegistry().getHelp(marker);
            if (contextId != null) {
                if (image == null)
                    image = JFaceResources.getImage(Dialog.DLG_IMG_HELP);
                else {
                    descriptors[IDecoration.TOP_RIGHT] = getIDEImageDescriptor(
                            MarkerSupportInternalUtilities.IMG_MARKERS_HELP_DECORATION_PATH);
                }
            }
            if (IDE.getMarkerHelpRegistry().hasResolutions(marker)) {
                if (image == MarkerSupportInternalUtilities.getSeverityImage(IMarker.SEVERITY_WARNING)) {
                    image = WorkbenchPlugin.getDefault().getSharedImages()
                            .getImage(IDEInternalWorkbenchImages.IMG_OBJS_FIXABLE_WARNING);
                } else if (image == MarkerSupportInternalUtilities.getSeverityImage(IMarker.SEVERITY_ERROR)) {
                    image = WorkbenchPlugin.getDefault().getSharedImages()
                            .getImage(IDEInternalWorkbenchImages.IMG_OBJS_FIXABLE_ERROR);
                } else if (image != null) {
                    descriptors[IDecoration.BOTTOM_RIGHT] = getIDEImageDescriptor(
                            MarkerSupportInternalUtilities.IMG_MARKERS_QUICK_FIX_DECORATION_PATH);
                }
                if (image == null) {
                    image = WorkbenchPlugin.getDefault().getSharedImages()
                            .getImage(IDEInternalWorkbenchImages.IMG_ELCL_QUICK_FIX_ENABLED);
                }
            }

            if (descriptors[IDecoration.TOP_RIGHT] != null || descriptors[IDecoration.BOTTOM_RIGHT] != null)
                image = getImageManager().createImage(new DecorationOverlayIcon(image, descriptors));
        }
    }
    return image;

}