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.apache.hadoop.eclipse.ui.internal.hdfs.HDFSLightweightLabelDecorator.java

License:Apache License

protected void decorate(HDFSFileStore store, IDecoration decoration) {
    if (store != null) {
        if (store.isLocalFile())
            decoration.addOverlay(org.apache.hadoop.eclipse.ui.Activator.IMAGE_LOCAL_OVR,
                    IDecoration.BOTTOM_LEFT);
        else if (store.isRemoteFile())
            decoration.addOverlay(org.apache.hadoop.eclipse.ui.Activator.IMAGE_REMOTE_OVR,
                    IDecoration.BOTTOM_LEFT);
        if (store.isLocalOnly())
            decoration.addOverlay(org.apache.hadoop.eclipse.ui.Activator.IMAGE_OUTGOING_OVR,
                    IDecoration.BOTTOM_RIGHT);

        Permissions effectivePermissions = store.getEffectivePermissions();
        if (effectivePermissions != null && !effectivePermissions.read && !effectivePermissions.write)
            decoration.addOverlay(org.apache.hadoop.eclipse.ui.Activator.IMAGE_READONLY_OVR);
    }//from ww  w  .j  a v a  2s .  c o  m
}

From source file:org.apache.sling.ide.eclipse.ui.internal.JcrNodeDecorator.java

License:Apache License

@Override
public void decorate(Object element, IDecoration decoration) {

    if (element instanceof JcrNode) {
        JcrNode node = (JcrNode) element;
        if (node.getPrimaryType() != null) {
            decoration.addSuffix(" [" + node.getPrimaryType() + "]");
        }//from   w w w  . j  a va 2 s.  c o m

        if (node instanceof SyncDir) {
            decoration.addOverlay(SharedImages.CONTENT_OVERLAY, IDecoration.BOTTOM_RIGHT);
        }
    }
}

From source file:org.apache.sling.ide.eclipse.ui.internal.ServersActionModeFiddlerActionDelegate.java

License:Apache License

private void initToolbarContributedActions() {
    cleanAction = new Action("Clean Publish...", IAction.AS_PUSH_BUTTON) {
        public void run() {
            if (server == null) {
                MessageDialog.openInformation(view.getSite().getShell(), "No server selected",
                        "A server must be selected");
                return;
            }//from w w  w  . j a v  a  2 s  .c  o  m
            int selection = 2;
            if (!doNotAskAgain) {
                MessageDialog dialog = new MessageDialog(view.getSite().getShell(), Messages.defaultDialogTitle,
                        null, Messages.dialogPublishClean, MessageDialog.QUESTION_WITH_CANCEL,
                        new String[] { "Cancel", "OK (do not ask again)", "OK" }, 1) {
                    @Override
                    protected void configureShell(Shell shell) {
                        super.configureShell(shell);
                        setShellStyle(getShellStyle() | SWT.SHEET);
                    }
                };
                selection = dialog.open();
            }
            if (selection != 0) {
                if (selection == 1) {
                    doNotAskAgain = true;
                }
                IAdaptable info = new IAdaptable() {
                    public Object getAdapter(Class adapter) {
                        if (Shell.class.equals(adapter))
                            return view.getSite().getShell();
                        if (String.class.equals(adapter))
                            return "user";
                        return null;
                    }
                };

                server.publish(IServer.PUBLISH_CLEAN, modules, info, null);
            }
        }
    };
    cleanAction.setText("Clean Publish...");
    cleanAction.setToolTipText("Clean and Publish...");
    ImageDescriptor cleanAndPublishImageDesc = new DecorationOverlayIcon(
            ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_PUBLISH).createImage(),
            ImageDescriptor.createFromFile(SharedImages.class, "refresh.gif"), IDecoration.BOTTOM_RIGHT);
    cleanAction.setImageDescriptor(cleanAndPublishImageDesc);
    cleanAction.setId("org.apache.sling.ide.eclipse.ui.actions.CleanPublishAction");
    publishAction = new Action("Publish", IAction.AS_PUSH_BUTTON) {
        public void run() {
            if (server == null) {
                MessageDialog.openInformation(view.getSite().getShell(), "No server selected",
                        "A server must be selected");
                return;
            }
            IAdaptable info = new IAdaptable() {
                public Object getAdapter(Class adapter) {
                    if (Shell.class.equals(adapter))
                        return view.getSite().getShell();
                    if (String.class.equals(adapter))
                        return "user";
                    return null;
                }
            };

            server.publish(IServer.PUBLISH_INCREMENTAL, modules, info, null);
        }
    };
    publishAction.setText("Publish");
    publishAction.setToolTipText("Publish");
    publishAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_PUBLISH));
    publishAction.setId("org.apache.sling.ide.eclipse.ui.actions.PublishAction");
    cleanAction.setEnabled(false);
    publishAction.setEnabled(false);

    cleanActionContributionItem = new ActionContributionItem(cleanAction);
    publishActionContributionItem = new ActionContributionItem(publishAction);

    appendedToolbarActionContributionItems.add(publishActionContributionItem);
    appendedToolbarActionContributionItems.add(cleanActionContributionItem);
}

From source file:org.apache.sling.ide.eclipse.ui.internal.SlingProjectDecorator.java

License:Apache License

@Override
public void decorate(Object element, IDecoration decoration) {
    if (!(element instanceof IProject)) {
        return;//from www . ja v  a 2s .c  o m
    }
    IProject project = (IProject) element;
    if (ProjectHelper.isBundleProject(project) || ProjectHelper.isContentProject(project)) {
        // then decorate
        decoration.addOverlay(SharedImages.SLING_DECORATION, IDecoration.BOTTOM_RIGHT);
    } else {
        // dont decorate
        return;
    }
}

From source file:org.bonitasoft.studio.configuration.ui.wizard.WizardPageDecorator.java

License:Open Source License

@Override
public Image decorateImage(Image image, Object element) {
    IProcessConfigurationWizardPage page = (IProcessConfigurationWizardPage) element;
    String erroMessage = page.isConfigurationPageValid(dialog.getConfiguration());
    if (image != null && erroMessage != null) {
        return new DecorationOverlayIcon(image,
                Pics.getImageDescriptor("problem.gif", ConfigurationPlugin.getDefault()),
                IDecoration.BOTTOM_RIGHT).createImage();
    }// w  w w. j a va  2 s . c o  m

    return null;
}

From source file:org.bonitasoft.studio.dependencies.ui.MissingDependenciesDecorator.java

License:Open Source License

protected Image getErrorDecoratedImage(Image image) {
    if (errorIcon == null) {
        errorIcon = new DecorationOverlayIcon(image, new ImageDescriptor() {

            @Override/*from   ww w. j a v  a2 s .c  o m*/
            public ImageData getImageData() {
                return errorDecoratorImage.getImageData();
            }
        }, IDecoration.BOTTOM_RIGHT).createImage();
    }
    return errorIcon;
}

From source file:org.bonitasoft.studio.dependencies.ui.MissingDependenciesDecorator.java

License:Open Source License

protected Image getWarningDecoratedImage(Image image) {
    if (warningIcon == null) {

        warningIcon = new DecorationOverlayIcon(image, new ImageDescriptor() {

            @Override/* w w  w .j a  v a 2 s. c om*/
            public ImageData getImageData() {
                return warningDecoratorImage.getImageData();
            }
        }, IDecoration.BOTTOM_RIGHT).createImage();
    }
    return warningIcon;
}

From source file:org.codehaus.groovy.eclipse.ui.decorators.GroovyElementDecorator.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {
    if (element instanceof IAdaptable) {
        IMember member = (IMember) ((IAdaptable) element).getAdapter(IMember.class);
        if (member != null) {
            try {
                ICompilationUnit unit = member.getCompilationUnit();
                if (unit != null) {
                    IResource resource = unit.getResource();
                    if (resource != null && ContentTypeUtils.isGroovyLikeFileName(resource.getName())) {
                        decoration.addOverlay(GroovyPluginImages.DESC_GROOVY_OVERLAY, IDecoration.BOTTOM_RIGHT);
                    }/* w w w.ja  v a 2  s  . c o m*/
                }
            } catch (Exception e) {
                // ignore???
            }
        }
    }
}

From source file:org.eclipse.babel.editor.tree.internal.KeyTreeLabelProvider.java

License:Open Source License

/**
 * @see ILabelProvider#getImage(Object)//w  w w .  java  2s.c  om
 */
public Image getImage(Object element) {
    if (element instanceof KeyTreeNode) {
        KeyTreeNode node = (KeyTreeNode) element;
        Collection<IMessageCheck> c = editor.getMarkers().getFailedChecks(node.getMessageKey());
        if (c == null || c.isEmpty()) {
            // Return the default key image as no issue exists
            return UIUtils.getKeyImage();
        }
        if (editor.getMarkers().isUnusedKey(node.getMessageKey(), false)) {
            if (editor.getMarkers().isMissingKey(node.getMessageKey())) {
                return UIUtils.getMissingAndUnusedTranslationsImage();
            } else if (editor.getMarkers().isDuplicateValue(node.getMessageKey())) {
                return UIUtils.getDuplicateEntryAndUnusedTranslationsImage();
            }
            return UIUtils.getUnusedTranslationsImage();
        } else if (editor.getMarkers().isMissingKey(node.getMessageKey())) {
            return UIUtils.getMissingTranslationImage();
        } else if (editor.getMarkers().isDuplicateValue(node.getMessageKey())) {
            return UIUtils.getDuplicateEntryImage();
        }

        // This shouldnt happen, but just in case a default key with a
        // warning icon will be showed
        Image someWarning = UIUtils.getKeyImage();
        ImageDescriptor warning = ImageDescriptor.createFromImage(UIUtils.getImage(UIUtils.IMAGE_WARNING));
        someWarning = new DecorationOverlayIcon(someWarning, warning, IDecoration.BOTTOM_RIGHT).createImage();
        return someWarning;
        // return UIUtils.getImage(UIUtils.IMAGE_WARNED_TRANSLATION);
    } else {
        /*
         * // Figure out background icon if
         * (messagesBundleGroup.isMessageKey(key)) { //TODO create check (or
         * else) // if (!noInactiveKeyCheck.checkKey(messagesBundleGroup,
         * node.getPath())) { // iconFlags += KEY_COMMENTED; // } else {
         * iconFlags += KEY_DEFAULT;
         * 
         * // } } else { iconFlags += KEY_VIRTUAL; }
         */

        return UIUtils.getKeyImage();

    }
}

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//from  w  w  w.  ja v  a 2  s  .  co  m
 */
public static Image getMissingTranslationImage() {
    Image result = ResourceManager.getImage(IMAGE_KEY_MISSING_TRANSLATION);
    if (result == null) {
        Image image = getImage(UIUtils.IMAGE_KEY);
        ImageDescriptor missing = ImageDescriptor.createFromImage(UIUtils.getImage(UIUtils.IMAGE_ERROR));
        result = new DecorationOverlayIcon(image, missing, IDecoration.BOTTOM_RIGHT).createImage();
        ResourceManager.addImage(IMAGE_KEY_MISSING_TRANSLATION, result);
    }
    return result;
}