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:org.eclipse.babel.editor.util.UIUtils.java

License:Open Source License

/**
 * @return Image for the icon which indicates a key that is unused
 *//*  w  ww .  ja va  2 s .c o  m*/
public static Image getUnusedTranslationsImage() {
    Image result = ResourceManager.getImage(IMAGE_KEY_UNUSED_TRANSLATION);
    if (result == null) {
        Image image = getImage(UIUtils.IMAGE_UNUSED_TRANSLATION);
        ImageDescriptor missing = ImageDescriptor.createFromImage(getImage(UIUtils.IMAGE_WARNING));
        result = new DecorationOverlayIcon(image, missing, IDecoration.BOTTOM_RIGHT).createImage();
        ResourceManager.addImage(IMAGE_KEY_UNUSED_TRANSLATION, result);
    }
    return result;
}

From source file:org.eclipse.babel.editor.util.UIUtils.java

License:Open Source License

/**
 * @return Image for the icon which indicates a key that has missing
 *         translations and is unused/*from  www.  j  a  va  2  s  .c o m*/
 */
public static Image getMissingAndUnusedTranslationsImage() {
    Image result = ResourceManager.getImage(IMAGE_KEY_MISSING_UNUSED_TRANSLATION);
    if (result == null) {
        Image image = getImage(UIUtils.IMAGE_UNUSED_TRANSLATION);
        ImageDescriptor missing = ImageDescriptor.createFromImage(getImage(UIUtils.IMAGE_ERROR));
        result = new DecorationOverlayIcon(image, missing, IDecoration.BOTTOM_RIGHT).createImage();
        ResourceManager.addImage(IMAGE_KEY_MISSING_UNUSED_TRANSLATION, result);
    }
    return result;
}

From source file:org.eclipse.babel.editor.util.UIUtils.java

License:Open Source License

/**
 * @return Image for the icon which indicates a key that has duplicate
 *         entries//from w  w  w  .  j  ava2s . c  o  m
 */
public static Image getDuplicateEntryImage() {
    Image result = ResourceManager.getImage(IMAGE_KEY_DUPLICATE_ENTRY_TRANSLATION);
    if (result == null) {
        Image image = getImage(UIUtils.IMAGE_KEY);
        ImageDescriptor missing = ImageDescriptor.createFromImage(getImage(UIUtils.IMAGE_WARNING));
        result = new DecorationOverlayIcon(image, missing, IDecoration.BOTTOM_RIGHT).createImage();
        ResourceManager.addImage(IMAGE_KEY_DUPLICATE_ENTRY_TRANSLATION, result);
    }
    return result;
}

From source file:org.eclipse.babel.editor.util.UIUtils.java

License:Open Source License

/**
 * @return Image for the icon which indicates a key that has duplicate
 *         entries and is unused//from w w  w  .j av a2 s. co m
 */
public static Image getDuplicateEntryAndUnusedTranslationsImage() {
    Image result = ResourceManager.getImage(IMAGE_KEY_UNUSED_DUPLICATE_ENTRY_TRANSLATION);
    if (result == null) {
        Image image = getImage(UIUtils.IMAGE_UNUSED_TRANSLATION);
        ImageDescriptor missing = ImageDescriptor.createFromImage(getImage(UIUtils.IMAGE_DUPLICATE));
        result = new DecorationOverlayIcon(image, missing, IDecoration.BOTTOM_RIGHT).createImage();
        ResourceManager.addImage(IMAGE_KEY_UNUSED_DUPLICATE_ENTRY_TRANSLATION, result);
    }
    return result;
}

From source file:org.eclipse.compare.internal.patch.DecoratorOverlayIcon.java

License:Open Source License

/**
 * Draw the overlays for the receiver./*  w w  w. j  a v a2 s  .  c o  m*/
 * @param overlaysArray the overlay images
 */
protected 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.datatools.connectivity.sqm.core.internal.ui.explorer.providers.decorators.impl.FilterNodeDecorationService.java

License:Open Source License

/**
 * @see org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(java.lang.Object, org.eclipse.jface.viewers.IDecoration)
 *//*w  ww . j ava  2 s.  co m*/
public void decorate(Object element, IDecoration decoration) {
    IFilterNode filterNode = (IFilterNode) element;
    if (hasFiltering(filterNode)) {
        decoration.addOverlay(ImageDescription.getFilterDecorationDescriptor(), IDecoration.BOTTOM_RIGHT);
        decoration.addSuffix(FILTERED);
    }
}

From source file:org.eclipse.eatop.examples.explorer.decorators.ModelReferenceDecorator.java

License:Open Source License

@Override
public void decorate(Object element, IDecoration decoration) {
    if (elementIsReferenced(element) && elementIsInstanceReferenced(element)) {
        decoration.addOverlay(referenceOverlay, IDecoration.TOP_LEFT);
        decoration.addOverlay(instanceRefOverlay, IDecoration.BOTTOM_RIGHT);
    } else if (elementIsReferenced(element)) {
        decoration.addOverlay(referenceOverlay, IDecoration.TOP_LEFT);
    } else if (elementIsInstanceReferenced(element)) {
        decoration.addOverlay(instanceRefOverlay, IDecoration.BOTTOM_RIGHT);
    } else {//w w w. j av a2s  . com
        decoration.addOverlay(null);
    }
}

From source file:org.eclipse.egit.ui.internal.DecorationOverlayDescriptor.java

License:Open Source License

/**
 * Draw the overlays for the receiver.//from   w ww. ja v  a  2 s.c  om
 *
 * @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.egit.ui.internal.history.FileDiff.java

License:Open Source License

public ImageDescriptor getImageDescriptor(Object object) {
    final ImageDescriptor base;
    if (!isSubmodule())
        base = UIUtils.getEditorImage(getPath());
    else//from  w  w  w  .j a va2 s . c o m
        base = UIIcons.REPOSITORY;
    switch (getChange()) {
    case ADD:
        return new DecorationOverlayDescriptor(base, UIIcons.OVR_STAGED_ADD, IDecoration.BOTTOM_RIGHT);
    case DELETE:
        return new DecorationOverlayDescriptor(base, UIIcons.OVR_STAGED_REMOVE, IDecoration.BOTTOM_RIGHT);
    default:
        return base;
    }
}

From source file:org.eclipse.egit.ui.internal.staging.StagingViewLabelProvider.java

License:Open Source License

private Image getDecoratedImage(Image base, ImageDescriptor decorator) {
    DecorationOverlayIcon decorated = new DecorationOverlayIcon(base, decorator, IDecoration.BOTTOM_RIGHT);
    return (Image) this.resourceManager.get(decorated);
}