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

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

Introduction

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

Prototype

int TOP_LEFT

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

Click Source Link

Document

Constants for placement of image decorations.

Usage

From source file:org.eclipse.m2m.internal.qvt.oml.debug.ui.QVTODebugUIPlugin.java

License:Open Source License

@Override
protected ImageRegistry createImageRegistry() {
    ImageRegistry imageRegistry = super.createImageRegistry();
    imageRegistry.put(QVTODebugImages.LOCAL_VARIABLE, imageDescriptor("localvar_obj.gif")); //$NON-NLS-1$      
    imageRegistry.put(QVTODebugImages.THIS_VARIABLE, imageDescriptor("thisvar_obj.gif")); //$NON-NLS-1$
    imageRegistry.put(QVTODebugImages.PREDEFINED_VARIABLE, imageDescriptor("predefvar_obj.gif")); //$NON-NLS-1$
    imageRegistry.put(QVTODebugImages.MODEL_PARAMETER, imageDescriptor("modelpar_obj.gif")); //$NON-NLS-1$
    imageRegistry.put(QVTODebugImages.ATTRIBUTE, imageDescriptor("attribute_obj.gif")); //$NON-NLS-1$
    imageRegistry.put(QVTODebugImages.REFERENCE, imageDescriptor("reference_obj.gif")); //$NON-NLS-1$
    imageRegistry.put(QVTODebugImages.COLLECTION_ELEMENT, imageDescriptor("index_element_obj.gif")); //$NON-NLS-1$

    imageRegistry.put(QVTODebugImages.INTERM_PROPERTY, overlayImage("intermprop_ovr.gif", //$NON-NLS-1$ 
            imageRegistry.get(QVTODebugImages.ATTRIBUTE), IDecoration.BOTTOM_RIGHT));

    imageRegistry.put(QVTODebugImages.CONDITIONAL_BPNT_ENABLED, overlayImage("conditional_ovr.gif", //$NON-NLS-1$ 
            DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT), IDecoration.TOP_LEFT));
    imageRegistry.put(QVTODebugImages.CONDITIONAL_BPNT_DISABLED, overlayImage("conditional_ovr_disabled.gif", //$NON-NLS-1$
            DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_DISABLED), IDecoration.TOP_LEFT));

    return imageRegistry;
}

From source file:org.eclipse.m2m.internal.qvt.oml.runtime.ui.trace.TraceViewLabelProvider.java

License:Open Source License

private Image getDecoratedImage(Image baseImage, String decoratorKey) {
    ImageDescriptor decoratorId = CommonPluginImages.getInstance().getImageDescriptor(decoratorKey);
    DecorationOverlayIcon decoratedIconId = new DecorationOverlayIcon(baseImage, decoratorId,
            IDecoration.TOP_LEFT);
    Image decoratedImage = decoratedIconId.createImage();
    myImageCache.add(decoratedImage);//  ww w .  j av a2s  .co  m
    return decoratedImage;
}

From source file:org.eclipse.ocl.examples.modelregistry.ui.icons.DecorationOverlayIcon.java

License:Open Source License

/**
  * Draw the overlays for the receiver./*  w w w  .java 2  s  . co m*/
  * @param overlaysArray 
  */
private void drawOverlays(ImageDescriptor[] overlaysArray) {

    for (int i = 0; i < overlays.length; i++) {
        ImageDescriptor overlay = overlaysArray[i];
        if (overlay == null) {
            continue;
        }
        ImageData overlayData = overlay.getImageData();
        //Use the missing descriptor if it is not there.
        if (overlayData == null) {
            overlayData = ImageDescriptor.getMissingImageDescriptor().getImageData();
        }
        switch (i) {
        case IDecoration.TOP_LEFT:
            drawImage(overlayData, 0, 0);
            break;
        case IDecoration.TOP_RIGHT:
            drawImage(overlayData, size.x - overlayData.width, 0);
            break;
        case IDecoration.BOTTOM_LEFT:
            drawImage(overlayData, 0, size.y - overlayData.height);
            break;
        case IDecoration.BOTTOM_RIGHT:
            drawImage(overlayData, size.x - overlayData.width, size.y - overlayData.height);
            break;
        }
    }
}

From source file:org.eclipse.oomph.launches.LaunchConfigLabelDecorator.java

License:Open Source License

public Image decorateImage(Image image, Object element) {
    if (image != null) {
        if (isLocal(element)) {
            DecorationOverlayIcon icon = new DecorationOverlayIcon(image, LOCAL_OVERLAY, IDecoration.TOP_LEFT);
            return (Image) resourceManager.get(icon);
        }//from  w  w  w  .j ava  2 s . co  m

        if (isExampleCopy(element)) {
            DecorationOverlayIcon icon = new DecorationOverlayIcon(image, EXAMPLE_OVERLAY,
                    IDecoration.TOP_LEFT);
            return (Image) resourceManager.get(icon);
        }
    }

    return null;
}

From source file:org.eclipse.papyrus.views.modelexplorer.core.ui.pagebookview.ModelExplorerDecorationAdapter.java

License:Open Source License

/**
 * Sets the decorated image.//w w w .  j a v  a 2  s .c  om
 *
 * @param baseImage the base image
 * @param decoration the decoration
 * @param decorationPosition the decoration position
 */
public void setDecoratedImage(Image baseImage, ImageDescriptor decoration, int decorationPosition) {

    if (decoration == null || baseImage == null) {
        return;
    }

    DecorationOverlayIcon decoratedImage = null;

    // Construct a new image identifier
    String decoratedImageId = baseImage.toString().concat(decoration.toString() + decorationPosition);

    // Return the stored image if we have one
    if (Activator.getDefault().getImageRegistry().get(decoratedImageId) == null) {
        // Otherwise create a new image and store it
        switch (decorationPosition) {

        case IDecoration.TOP_LEFT:
            decoratedImage = new DecorationOverlayIcon(baseImage,
                    new ImageDescriptor[] { decoration, null, null, null, null }, size16);
            break;
        case IDecoration.TOP_RIGHT:
            decoratedImage = new DecorationOverlayIcon(baseImage,
                    new ImageDescriptor[] { null, decoration, null, null, null }, size16);
            break;
        case IDecoration.BOTTOM_LEFT:
            decoratedImage = new DecorationOverlayIcon(baseImage,
                    new ImageDescriptor[] { null, null, decoration, null, null }, size16);
            break;
        case IDecoration.BOTTOM_RIGHT:
            decoratedImage = new DecorationOverlayIcon(baseImage,
                    new ImageDescriptor[] { null, null, null, decoration, null }, size16);
            break;
        case IDecoration.UNDERLAY:
            decoratedImage = new DecorationOverlayIcon(baseImage,
                    new ImageDescriptor[] { null, null, null, null, decoration }, size16);
            break;
        default:
            decoratedImage = new DecorationOverlayIcon(baseImage,
                    new ImageDescriptor[] { null, null, decoration, null, null }, size16);
            break;
        }
        Activator.getDefault().getImageRegistry().put(decoratedImageId, decoratedImage);
    }

}

From source file:org.eclipse.papyrus.views.modelexplorer.core.ui.pagebookview.ModelExplorerDecorationAdapter.java

License:Open Source License

/**
 * Sets the decoration.//from  w  ww. j  a  v  a 2 s  .  c o  m
 *
 * @param decoration the decoration
 * @param position the position
 */
public void setDecoration(ImageDescriptor decoration, PreferedPosition position) {
    switch (position) {

    case NORTH_WEST:
        setDecoration(decoration, IDecoration.TOP_LEFT);
        break;
    case NORTH:
        setDecoration(decoration, IDecoration.TOP_RIGHT);
        break;
    case NORTH_EAST:
        setDecoration(decoration, IDecoration.TOP_RIGHT);
        break;
    case EAST:
        setDecoration(decoration, IDecoration.BOTTOM_RIGHT);
        break;
    case SOUTH_EAST:
        setDecoration(decoration, IDecoration.BOTTOM_RIGHT);
        break;
    case SOUTH:
        setDecoration(decoration, IDecoration.BOTTOM_LEFT);
        break;
    case SOUTH_WEST:
        setDecoration(decoration, IDecoration.BOTTOM_LEFT);
        break;
    case WEST:
        setDecoration(decoration, IDecoration.TOP_LEFT);
        break;
    case CENTER:
        setDecoration(decoration, IDecoration.UNDERLAY);
        break;
    default:
        setDecoration(decoration, IDecoration.BOTTOM_LEFT);
        break;

    }
}

From source file:org.eclipse.recommenders.completion.rcp.processable.Proposals.java

License:Open Source License

public static void overlay(IProcessableProposal proposal, ImageDescriptor icon) {
    overlay(proposal, icon, IDecoration.TOP_LEFT);
}

From source file:org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.java

License:Open Source License

@Inject
public CallCompletionSessionProcessor(IProjectCoordinateProvider pcProvider, ICallModelProvider modelProvider,
        IProposalNameProvider methodNameProvider, CallsRcpPreferences prefs, SharedImages images) {
    this.pcProvider = pcProvider;
    this.modelProvider = modelProvider;
    this.methodNameProvider = methodNameProvider;
    this.prefs = prefs;
    this.overlayProcessor = new OverlayImageProposalProcessor(images.getDescriptor(OVR_STAR),
            IDecoration.TOP_LEFT);
}

From source file:org.eclipse.recommenders.internal.constructors.rcp.ConstructorCompletionSessionProcessor.java

License:Open Source License

@Inject
public ConstructorCompletionSessionProcessor(IProjectCoordinateProvider pcProvider,
        IConstructorModelProvider modelProvider, IProposalNameProvider methodNameProvider,
        ConstructorsRcpPreferences prefs, SharedImages images) {
    this.pcProvider = requireNonNull(pcProvider);
    this.modelProvider = requireNonNull(modelProvider);
    this.methodNameProvider = requireNonNull(methodNameProvider);
    this.prefs = requireNonNull(prefs);
    this.overlayProcessor = new OverlayImageProposalProcessor(images.getDescriptor(OVR_STAR),
            IDecoration.TOP_LEFT);
}

From source file:org.eclipse.recommenders.internal.overrides.rcp.OverrideCompletionSessionProcessor.java

License:Open Source License

@Inject
public OverrideCompletionSessionProcessor(IProjectCoordinateProvider pcProvider,
        IOverrideModelProvider modelProvider, JavaElementResolver cache, SharedImages images,
        OverridesRcpPreferences prefs) {
    this.pcProvider = pcProvider;
    this.modelProvider = modelProvider;
    this.jdtCache = cache;
    this.prefs = prefs;
    this.overlayProcessor = new OverlayImageProposalProcessor(images.getDescriptor(OVR_STAR),
            IDecoration.TOP_LEFT);
}