Example usage for org.eclipse.jface.action IAction setHoverImageDescriptor

List of usage examples for org.eclipse.jface.action IAction setHoverImageDescriptor

Introduction

In this page you can find the example usage for org.eclipse.jface.action IAction setHoverImageDescriptor.

Prototype

void setHoverImageDescriptor(ImageDescriptor newImage);

Source Link

Document

Sets the hover image for this action, as an image descriptor.

Usage

From source file:ca.usask.cs.srlab.simclipse.SimClipsePluginImages.java

License:Open Source License

public static void setImageDescriptors(IAction action, String type, String relPath) {
    relPath = relPath.substring(NAME_PREFIX_LENGTH);

    action.setDisabledImageDescriptor(create("d" + type, relPath, false)); //$NON-NLS-1$

    ImageDescriptor desc = create("e" + type, relPath, true); //$NON-NLS-1$
    action.setHoverImageDescriptor(desc);
    action.setImageDescriptor(desc);//from  www  .  j  a v a2s .co m
}

From source file:cideplus.ui.astview.ASTViewImages.java

License:Open Source License

public static void setImageDescriptors(IAction action, String type) {
    ImageDescriptor id = create("d", type); //$NON-NLS-1$
    if (id != null)
        action.setDisabledImageDescriptor(id);

    id = create("c", type); //$NON-NLS-1$
    if (id != null) {
        action.setHoverImageDescriptor(id);
        action.setImageDescriptor(id);// ww w .j av a  2 s  .c  o  m
    } else {
        action.setImageDescriptor(ImageDescriptor.getMissingImageDescriptor());
    }
}

From source file:com.aptana.editor.php.internal.ui.PHPPluginImages.java

License:Open Source License

private static void setImageDescriptors(IAction action, String type, String relPath) {
    ImageDescriptor id = create("d" + type, relPath, false); //$NON-NLS-1$
    if (id != null)
        action.setDisabledImageDescriptor(id);
    /*/*from   ww w .  j a v  a  2 s . co  m*/
     * id= create("c" + type, relPath, false); //$NON-NLS-1$ if (id != null) action.setHoverImageDescriptor(id);
     */
    ImageDescriptor descriptor = create("e" + type, relPath); //$NON-NLS-1$
    action.setHoverImageDescriptor(descriptor);
    action.setImageDescriptor(descriptor);
}

From source file:com.google.dart.tools.ui.DartPluginImages.java

License:Open Source License

private static void setImageDescriptors(IAction action, String type, String relPath) {
    ImageDescriptor id = create("d" + type, relPath, false); //$NON-NLS-1$
    if (id != null) {
        action.setDisabledImageDescriptor(id);
    }// ww  w  .ja  va2 s  . co  m

    /*
     * id= create("c" + type, relPath, false); //$NON-NLS-1$ if (id != null)
     * action.setHoverImageDescriptor(id);
     */

    ImageDescriptor descriptor = create("e" + type, relPath, true); //$NON-NLS-1$
    action.setHoverImageDescriptor(descriptor);
    action.setImageDescriptor(descriptor);
}

From source file:com.google.dart.tools.ui.internal.compare.DartCompareUtilities.java

License:Open Source License

/**
 * Initialize the given Action from a ResourceBundle.
 *//*from   w ww . ja v a2s . c  o  m*/
static void initAction(IAction a, ResourceBundle bundle, String prefix) {

    String labelKey = "label"; //$NON-NLS-1$
    String tooltipKey = "tooltip"; //$NON-NLS-1$
    String imageKey = "image"; //$NON-NLS-1$
    String descriptionKey = "description"; //$NON-NLS-1$

    if (prefix != null && prefix.length() > 0) {
        labelKey = prefix + labelKey;
        tooltipKey = prefix + tooltipKey;
        imageKey = prefix + imageKey;
        descriptionKey = prefix + descriptionKey;
    }

    a.setText(getString(bundle, labelKey, labelKey));
    a.setToolTipText(getString(bundle, tooltipKey, null));
    a.setDescription(getString(bundle, descriptionKey, null));

    String relPath = getString(bundle, imageKey, null);
    if (relPath != null && relPath.trim().length() > 0) {

        String dPath;
        String ePath;

        if (relPath.indexOf("/") >= 0) { //$NON-NLS-1$
            String path = relPath.substring(1);
            dPath = 'd' + path;
            ePath = 'e' + path;
        } else {
            dPath = "dlcl16/" + relPath; //$NON-NLS-1$
            ePath = "elcl16/" + relPath; //$NON-NLS-1$
        }

        ImageDescriptor id = DartCompareUtilities.getImageDescriptor(dPath); // we set the disabled image first (see PR 1GDDE87)
        if (id != null) {
            a.setDisabledImageDescriptor(id);
        }
        id = DartCompareUtilities.getImageDescriptor(ePath);
        if (id != null) {
            a.setImageDescriptor(id);
            a.setHoverImageDescriptor(id);
        }
    }
}

From source file:com.javadude.antxr.eclipse.ui.AntxrUIPluginImages.java

License:Open Source License

private static void setImageDescriptors(IAction anAction, String aType, String aRelPath) {
    try {//w  w w . j  av a 2s .com
        ImageDescriptor id = ImageDescriptor
                .createFromURL(AntxrUIPluginImages.makeIconFileURL("d" + aType, aRelPath));
        if (id != null) {
            anAction.setDisabledImageDescriptor(id);
        }
    } catch (MalformedURLException e) {
        AntxrUIPlugin.log(e);
    }

    try {
        ImageDescriptor id = ImageDescriptor
                .createFromURL(AntxrUIPluginImages.makeIconFileURL("c" + aType, aRelPath));
        if (id != null) {
            anAction.setHoverImageDescriptor(id);
        }
    } catch (MalformedURLException e) {
        AntxrUIPlugin.log(e);
    }

    anAction.setImageDescriptor(AntxrUIPluginImages.create("e" + aType, aRelPath));
}

From source file:com.technophobia.substeps.junit.ui.viewhistory.RunnerViewHistory.java

License:Open Source License

@Override
public void configureHistoryDropDownAction(final IAction action) {
    action.setToolTipText(SubstepsFeatureMessages.SubstepsFeatureTestRunnerViewPart_test_run_history);
    action.setDisabledImageDescriptor(/*from w  w  w  . j av  a 2s  .  c o  m*/
            iconProvider.imageDescriptorFor(SubstepsControlsIcon.HistoryListDisabled)); //$NON-NLS-1$
    action.setHoverImageDescriptor(iconProvider.imageDescriptorFor(SubstepsControlsIcon.HistoryListEnabled)); //$NON-NLS-1$
    action.setImageDescriptor(iconProvider.imageDescriptorFor(SubstepsControlsIcon.HistoryListEnabled)); //$NON-NLS-1$
}

From source file:com.windowtester.swt.util.ImageManager.java

License:Open Source License

/**
 * Sets all the image descriptors of a given action.  This method assumes
 * the following convention:<OL>/*from w  ww  .  j a v  a  2s  .  co m*/
 * <LI>The prefix type "e" is used for the main image</LI>
 * <LI>The prefix type "c" is used for the hover image</LI>
 * <LI>The prefix type "d" is used for the disabled image</LI>
 * </OL>
 * 
 * @param action
 * @param name
 */
public void setImageDescriptors(IAction action, String name) {
    ImageDescriptor imageDescriptor = getImageDescriptor("d", name);
    if (imageDescriptor != null)
        action.setDisabledImageDescriptor(imageDescriptor);

    imageDescriptor = getImageDescriptor("c", name);
    if (imageDescriptor != null)
        action.setHoverImageDescriptor(imageDescriptor);

    imageDescriptor = getImageDescriptor("e", name);
    if (imageDescriptor != null)
        action.setImageDescriptor(imageDescriptor);
}

From source file:de.fu_berlin.inf.jtourbus.utility.IconManager.java

License:Open Source License

public static void setImageDescriptors(IAction action, String type) {

    try {//from  w ww.  ja va2 s.co  m
        ImageDescriptor id = ImageDescriptor.createFromURL(makeIconFileURL("dlcl16", type)); //$NON-NLS-1$
        if (id != null)
            action.setDisabledImageDescriptor(id);
    } catch (MalformedURLException e) {
    }

    try {
        ImageDescriptor id = ImageDescriptor.createFromURL(makeIconFileURL("elcl16", type)); //$NON-NLS-1$
        if (id != null) {
            action.setHoverImageDescriptor(id);
            action.setImageDescriptor(id);
        }
    } catch (MalformedURLException e) {
    }

    action.setImageDescriptor(create("e", type)); //$NON-NLS-1$
}

From source file:de.ovgu.cide.ColoredIDEImages.java

License:Open Source License

/**
 * loads icon from c and d subdirectories!
 *//*from   w w  w.  j a  v a 2  s. c  o  m*/
public static void setImageDescriptors(IAction action, String type) {
    ImageDescriptor id = create("d", type); //$NON-NLS-1$
    if (id != null)
        action.setDisabledImageDescriptor(id);

    id = create("c", type); //$NON-NLS-1$
    if (id != null) {
        action.setHoverImageDescriptor(id);
        action.setImageDescriptor(id);
    } else {
        action.setImageDescriptor(ImageDescriptor.getMissingImageDescriptor());
    }
}