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:com.google.dart.tools.ui.internal.viewsupport.DartElementImageProvider.java

License:Open Source License

private static ImageDescriptor decorate(ImageDescriptor main, ImageDescriptor badge) {
    return new DecorationOverlayIcon(DartToolsPlugin.getImageDescriptorRegistry().get(main), badge,
            IDecoration.BOTTOM_RIGHT);
}

From source file:com.google.gdt.eclipse.managedapis.ui.ManageApiInfoDecorator.java

License:Open Source License

private void applyUpdateAvailableDecoration(IDecoration decoration) throws MalformedURLException {
    decoration.addSuffix(" [Update available]");
    ImageDescriptor overlay = resources.getUpdateAvailableOverlay16ImageDescriptor();
    decoration.addOverlay(overlay, IDecoration.BOTTOM_RIGHT);
}

From source file:com.nextep.designer.vcs.ui.decorators.UserLockDecorator.java

License:Open Source License

@Override
public void decorate(Object element, IDecoration decoration) {
    if (element instanceof IVersionable<?>) {
        final IVersionable<?> versionable = (IVersionable<?>) element;
        final IVersionInfo version = versionable.getVersion();
        if (version.getStatus() != IVersionStatus.CHECKED_IN
                && versionable.getType() != IElementType.getInstance(IVersionContainer.TYPE_ID)) {
            if (version.getUser() != VCSPlugin.getViewService().getCurrentUser()) {
                if (descriptor == null) {
                    descriptor = ImageDescriptor.createFromImage(ImageFactory.ICON_USER_LOCK_TINY);
                }//from w w w . ja v a  2s  .  c  om
                quadrant = IDecoration.BOTTOM_RIGHT;
                decoration.addOverlay(descriptor, quadrant);
            }

        }
    }
}

From source file:com.nextep.designer.vcs.ui.decorators.VersionableDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {

    if (element instanceof IVersionable<?>) {
        if (((IVersionable<?>) element).getVersion().getStatus() == IVersionStatus.CHECKED_IN) {
            if (descriptor == null) {
                descriptor = ImageDescriptor.createFromImage(ImageFactory.ICON_LOCK_TINY);
            }/* w w w  .j  a v  a2s. co m*/
            quadrant = IDecoration.BOTTOM_RIGHT;
            decoration.addOverlay(descriptor, quadrant);

        }
    }
}

From source file:com.nokia.tools.vct.confml.editor.include.xincmodel.presentation.BadIncludeReferenceDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    if (hasError(element)) {
        lazyInit();
        decoration.addOverlay(descr, IDecoration.BOTTOM_RIGHT);
    }
}

From source file:com.quantcomponents.ui.algo.ExecutionRunningDecorator.java

License:Open Source License

@Override
public void decorate(Object element, IDecoration decoration) {
    if (element instanceof TradingAgentExecutionWrapper) {
        TradingAgentExecutionWrapper wrapper = (TradingAgentExecutionWrapper) element;
        if (wrapper.getManager().getRunningStatus(wrapper.getHandle()) == RunningStatus.PAUSED) {
            ImageDescriptor imageDescriptor = TradingAgentPlugin.getDefault().getImageRegistry()
                    .getDescriptor(TradingAgentPlugin.DECORATOR_PAUSED_IMAGE_KEY);
            decoration.addOverlay(imageDescriptor, IDecoration.BOTTOM_RIGHT);
        } else if (wrapper.getManager().getRunningStatus(wrapper.getHandle()) == RunningStatus.RUNNING) {
            ImageDescriptor imageDescriptor = TradingAgentPlugin.getDefault().getImageRegistry()
                    .getDescriptor(TradingAgentPlugin.DECORATOR_RUNNING_IMAGE_KEY);
            decoration.addOverlay(imageDescriptor, IDecoration.BOTTOM_RIGHT);
        }//from ww  w.j  a v  a  2  s .  c o  m
    }
}

From source file:com.quantcomponents.ui.marketdata.AutoUpdateIconDecorator.java

License:Open Source License

@Override
public void decorate(Object element, IDecoration decoration) {
    if (element instanceof StockDatabasePresentationWrapper) {
        StockDatabasePresentationWrapper stockDatabase = (StockDatabasePresentationWrapper) element;
        if (stockDatabase.isRealtimeUpdate()) {
            ImageDescriptor imageDescriptor = MarketDataPlugin.getDefault().getImageRegistry()
                    .getDescriptor(MarketDataPlugin.DECORATOR_AUTOUPDATE_IMAGE_KEY);
            decoration.addOverlay(imageDescriptor, IDecoration.BOTTOM_RIGHT);
        }//from w ww . j  av a  2  s  .c o m
    }
}

From source file:com.rcpcompany.uibindings.internal.decorators.extenders.ViewerSpecificLabelDecoratorExtender.java

License:Open Source License

@Override
public void extend(final IUIBindingDecoratorExtenderContext context) {
    final ValidationLabelDecorator labelDecorator = getLabelDecorator(context.getBinding());

    if (labelDecorator == null)
        return;/*  ww w  . j ava 2 s .c om*/

    /*
     * We want to be notified next time the decorator changes...
     * 
     * Note that we expect the decorator to conform to the comment of #addListener(): "Adds a
     * listener to this label provider. Has no effect if an identical listener is already
     * registered.".
     * 
     * This is done this way to avoid any references from the extender to the decorator, as
     * these can be problematic when garbage collecting...
     */
    labelDecorator.addListener(this);

    final EObject element = context.getBinding().getModelObject();

    final IDecoration decoration = new IDecoration() {
        @Override
        public void addPrefix(String prefix) {
            // TODO
        }

        @Override
        public void addSuffix(String suffix) {
            // TODO
        }

        @Override
        public void addOverlay(ImageDescriptor overlay) {
            final DecorationPosition pos = IManager.Factory.getManager().getMessageDecorationPosition();
            switch (pos) {
            case TOP_LEFT:
            case CENTER_LEFT:
                addOverlay(overlay, IDecoration.TOP_LEFT);
                break;
            case BOTTOM_LEFT:
                addOverlay(overlay, IDecoration.BOTTOM_LEFT);
                break;
            case TOP_RIGHT:
            case CENTER_RIGHT:
                addOverlay(overlay, IDecoration.TOP_RIGHT);
                break;
            case BOTTOM_RIGHT:
                addOverlay(overlay, IDecoration.BOTTOM_RIGHT);
                break;
            default:
                LogUtils.error(this, "Unknown position: " + pos);
                addOverlay(overlay, IDecoration.TOP_LEFT);
                break;
            }
        }

        @Override
        public void addOverlay(ImageDescriptor overlay, int quadrant) {
            final Image image = getResourceManager().createImage(overlay);
            switch (quadrant) {
            case IDecoration.BOTTOM_LEFT:
                context.setDecoratingImage(DecorationPosition.BOTTOM_LEFT, false, image, null);
                break;
            case IDecoration.TOP_LEFT:
                context.setDecoratingImage(DecorationPosition.TOP_LEFT, false, image, null);
                break;
            case IDecoration.BOTTOM_RIGHT:
                context.setDecoratingImage(DecorationPosition.BOTTOM_RIGHT, false, image, null);
                break;
            case IDecoration.TOP_RIGHT:
                context.setDecoratingImage(DecorationPosition.TOP_RIGHT, false, image, null);
                break;
            case IDecoration.REPLACE:
                context.setImage(image);
                break;
            default:
                LogUtils.error(this, "Unknown quadrant: " + quadrant);
                break;
            }
        }

        @Override
        public void setForegroundColor(Color color) {
            context.setForegound(color);
        }

        @Override
        public void setBackgroundColor(Color color) {
            context.setBackgound(color);
        }

        @Override
        public void setFont(Font font) {
            context.setFont(font);
        }

        @Override
        public IDecorationContext getDecorationContext() {
            return DecorationContext.DEFAULT_CONTEXT;
        }
    };
    labelDecorator.decorate(element, decoration);
}

From source file:com.sonatype.buildserver.api.HudsonImages.java

License:Open Source License

public static Image getOverlayImage(String base, String overlay, int quadrant) {
    assert quadrant == IDecoration.TOP_RIGHT
            || quadrant == IDecoration.BOTTOM_RIGHT : "only botton_right and top_right supported";
    return com.sonatype.buildserver.eclipse.ui.HudsonImages.getOverlayImage(base,
            quadrant == IDecoration.TOP_RIGHT ? overlay : null,
            quadrant == IDecoration.BOTTOM_RIGHT ? overlay : null);
}

From source file:com.teamunify.eclipse.mylyn.pt.ui.PtTaskListLabelDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    if (element instanceof ITask) {
        ITask task = (ITask) element;//from  ww  w .ja  v  a 2  s .c o m
        String kind = task.getTaskKind();
        if (kind.equalsIgnoreCase("bug")) {
            ImageDescriptor imageDescriptor = null;
            try {
                imageDescriptor = ImageDescriptor.createFromURL(getImageURL("bug.png"));
                decoration.addOverlay(imageDescriptor, IDecoration.BOTTOM_RIGHT);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}