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:eu.cloudwave.wp5.feedback.eclipse.performance.ui.decorators.FeedbackProjectNatureEnabledDecorator.java

License:Apache License

/**
 * {@inheritDoc}/*  w w w .  j av a  2 s. c  o  m*/
 */
@Override
public void decorate(final Object element, final IDecoration decoration) {
    final Optional<IProject> project = isProject(element);
    if (project.isPresent()) {
        try {
            if (project.get().isNatureEnabled(Ids.NATURE)) {
                decoration.addOverlay(PerformancePluginActivator.getImageDescriptor(DECORATOR_ICON_PATH),
                        IDecoration.TOP_LEFT);
            }
        } catch (final CoreException e) {
            // do nothing, decoration is not applied
        }
    }
}

From source file:eu.numberfour.n4js.ui.labeling.helper.N4JSDecoratorRow.java

License:Open Source License

@SuppressWarnings("javadoc")
public N4JSDecoratorRow(ImageDescriptor main, int quadrant, List<ImageDescriptor> decos) {
    Objects.requireNonNull(main);
    if ((quadrant < IDecoration.TOP_LEFT) || (quadrant > IDecoration.BOTTOM_RIGHT)) {
        throw new IllegalArgumentException();
    }/*from   ww  w .ja v a 2s  .  c om*/
    Objects.requireNonNull(decos);
    this.main = main;
    this.quadrant = quadrant;
    this.decos = decos.toArray(new ImageDescriptor[decos.size()]);
}

From source file:eu.numberfour.n4js.ui.labeling.helper.N4JSDecoratorRow.java

License:Open Source License

/**
 * Are the decorators aligned vertically on top?
 *///from www  .  jav a2s . c o m
private boolean isDecoTop() {
    switch (quadrant) {
    case IDecoration.TOP_LEFT:
    case IDecoration.TOP_RIGHT:
        return true;

    default:
        return false;
    }
}

From source file:eu.numberfour.n4js.ui.labeling.helper.N4JSDecoratorRow.java

License:Open Source License

/**
 * Do the decorators start on the left border?
 *///from www  .j a v  a 2s .  c  om
private boolean isDecoLeft() {
    switch (quadrant) {
    case IDecoration.TOP_LEFT:
    case IDecoration.BOTTOM_LEFT:
        return true;

    default:
        return false;
    }
}

From source file:ext.org.eclipse.jdt.internal.ui.wizards.buildpaths.CPVariableElementLabelProvider.java

License:Open Source License

public CPVariableElementLabelProvider(boolean highlightReadOnly) {
    ImageRegistry reg = JavaPlugin.getDefault().getImageRegistry();
    fJARImage = reg.get(JavaPluginImages.IMG_OBJS_EXTJAR);
    fFolderImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);

    fDeprecatedJARImage = new DecorationOverlayIcon(fJARImage, JavaPluginImages.DESC_OVR_DEPRECATED,
            IDecoration.TOP_LEFT).createImage();
    fDeprecatedFolderImage = new DecorationOverlayIcon(fFolderImage, JavaPluginImages.DESC_OVR_DEPRECATED,
            IDecoration.TOP_LEFT).createImage();

    fHighlightReadOnly = highlightReadOnly;
    fResolvedBackground = null;//from  w  ww.ja  va  2s  .  c om
}

From source file:gov.nasa.ensemble.core.plan.advisor.provider.ActivityAdvisorLabelDecorator.java

License:Open Source License

public ActivityAdvisorLabelDecorator() {
    if (badgeLocation == null) {
        return;/*w  ww.ja  v a 2  s. co  m*/
    }

    if (badgeLocation.equalsIgnoreCase("TOP_LEFT")) {
        quadrant = IDecoration.TOP_LEFT;
    }

    else if (badgeLocation.equalsIgnoreCase("TOP_RIGHT")) {
        quadrant = IDecoration.TOP_RIGHT;
    }

    else if (badgeLocation.equalsIgnoreCase("BOTTOM_LEFT")) {
        quadrant = IDecoration.BOTTOM_LEFT;
    }

    else if (badgeLocation.equalsIgnoreCase("BOTTOM_RIGHT")) {
        quadrant = IDecoration.BOTTOM_RIGHT;
    }

    else if (badgeLocation.equalsIgnoreCase("REPLACE")) {
        quadrant = IDecoration.BOTTOM_LEFT;
    }

    else if (badgeLocation.equalsIgnoreCase("UNDERLAY")) {
        quadrant = IDecoration.UNDERLAY;
    }

    else {
        LogUtil.warn("unsupported value entered for " + propertyKey + ", using default value instead");
    }
}

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  w  w. j av  a2  s. com*/
    }
}

From source file:net.sourceforge.eclipseccase.ui.ClearCaseDecorator.java

License:Open Source License

/**
 * Adds decoration for checked in state.
 * /*from  ww  w.  j a  v a  2s  . co  m*/
 * @param decoration
 */
private static void decorateCheckedIn(IDecoration decoration) {
    if (ClearCaseUI.DEBUG_DECORATION) {
        ClearCaseUI.trace(DECORATOR, "  decorateCheckedIn"); //$NON-NLS-1$
    }
    if (ClearCaseUIPreferences.decorateClearCaseElements())
        decoration.addOverlay(IMG_DESC_ELEMENT_BG, IDecoration.TOP_LEFT + IDecoration.UNDERLAY);
    decoration.addOverlay(IMG_DESC_CHECKED_IN);
}

From source file:net.sourceforge.eclipseccase.ui.ClearCaseDecorator.java

License:Open Source License

/**
 * Adds decoration for checked out state.
 * /*from   w ww  .  ja va 2  s.  co  m*/
 * @param decoration
 */
private static void decorateCheckedOut(IDecoration decoration, String version) {
    if (ClearCaseUI.DEBUG_DECORATION) {
        ClearCaseUI.trace(DECORATOR, "  decorateCheckedOut"); //$NON-NLS-1$
    }
    if (ClearCaseUIPreferences.decorateClearCaseElements())
        decoration.addOverlay(IMG_DESC_ELEMENT_BG, IDecoration.TOP_LEFT + IDecoration.UNDERLAY);
    decoration.addOverlay(IMG_DESC_CHECKED_OUT);
    if (ClearCaseUIPreferences.decorateElementStatesWithTextPrefix()) {
        decoration.addPrefix(ClearCaseUI.getTextPrefixDirty());
    }

    if (ClearCaseUIPreferences.decorateElementsWithVersionInfo() && null != version) {
        decoration.addSuffix("  " + version); //$NON-NLS-1$
    }
}

From source file:net.sourceforge.eclipseccase.ui.ClearCaseDecorator.java

License:Open Source License

/**
 * Adds decoration for dirty state.//from   w ww. j a v a  2  s  . c o  m
 * 
 * @param decoration
 */
private static void decorateDirty(IDecoration decoration) {
    if (ClearCaseUI.DEBUG_DECORATION) {
        ClearCaseUI.trace(DECORATOR, "  decorateDirty"); //$NON-NLS-1$
    }
    if (ClearCaseUIPreferences.decorateClearCaseElements())
        decoration.addOverlay(IMG_DESC_ELEMENT_BG, IDecoration.TOP_LEFT + IDecoration.UNDERLAY);
    decoration.addOverlay(IMG_DESC_DIRTY);
    if (ClearCaseUIPreferences.decorateElementStatesWithTextPrefix()) {
        decoration.addPrefix(ClearCaseUI.getTextPrefixDirty());
    }
}