Java Code Examples for org.eclipse.ui.plugin.AbstractUIPlugin#imageDescriptorFromPlugin()

The following examples show how to use org.eclipse.ui.plugin.AbstractUIPlugin#imageDescriptorFromPlugin() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SVNPluginAction.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public SVNPluginAction(IConfigurationElement element) {
	super(element.getAttribute(ATT_LABEL), getStyleFromElement(element));
	this.element = element;
	pluginId = element.getContributor().getName();
	
	createDelegate();
	
	setId(element.getAttribute(ATT_ID));
	setToolTipText(element.getAttribute(ATT_TOOLTIP));
	
	if ((getStyle() == AS_RADIO_BUTTON) || (getStyle() == AS_CHECK_BOX)) {
		String bool = element.getAttribute(ATT_STATE);
		setChecked("true".equals(bool));	//$NON-NLS-1$
	}
	
	String iconPath = element.getAttribute(ATT_ICON);
	if ((iconPath != null) && (iconPath.length() > 0)) {
		ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, iconPath);
		if (desc != null) {
			setImageDescriptor(desc);
		}
	}
	
	 // Give delegate a chance to adjust enable state
       selectionChanged(StructuredSelection.EMPTY);
}
 
Example 2
Source File: ConfigurationTypesUI.java    From eclipse-cs with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Return an image for the given configuration type.
 * 
 * @param configType
 *          the configuration type
 * @return the image representing the configuration type or <code>null</code>
 *         if no image is registered
 */
public static Image getConfigurationTypeImage(IConfigurationType configType) {

  String iconPath = CONFIGATION_TYPE_ICONS.get(configType.getInternalName());

  if (iconPath != null) {
    ImageDescriptor descriptor = AbstractUIPlugin
            .imageDescriptorFromPlugin(CheckstyleUIPlugin.PLUGIN_ID, iconPath);
    return CheckstyleUIPluginImages.getImage(descriptor);
  }
  return null;
}
 
Example 3
Source File: NPMEditorPluginImageHelper.java    From typescript.java with MIT License 5 votes vote down vote up
/**
 * Creates an image descriptor from the given imageFilePath and adds the
 * image descriptor to the image descriptor registry. If an image descriptor
 * could not be created, the default "missing" image descriptor is returned
 * but not added to the image descriptor registry.
 * 
 * @param imageFilePath
 * @return ImageDescriptor image descriptor for imageFilePath or default
 *         "missing" image descriptor if resource could not be found
 */
private ImageDescriptor createImageDescriptor(String imageFilePath) {
	ImageDescriptor imageDescriptor = AbstractUIPlugin
			.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
	if (imageDescriptor != null) {
		getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
	} else {
		imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
	}

	return imageDescriptor;
}
 
Example 4
Source File: ExamplesView.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Returns an image descriptor for the image file at the given plug-in relative
 * path.
 *
 * @param path the path
 * @return the image descriptor
 */
public static ImageDescriptor getImageDescriptor(String path) {
	try {
		return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.nebula.examples", path);
	} catch (Throwable e) {
		return ImageDescriptor.getMissingImageDescriptor();
	}
}
 
Example 5
Source File: XMLPlugin.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public static ImageDescriptor getImageDescriptor(String path)
{
	return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 6
Source File: ExportWizardPage.java    From spotbugs with GNU Lesser General Public License v2.1 4 votes vote down vote up
protected ExportWizardPage(String pageName, String title, String descr, String imagePath) {
    super(pageName, title, AbstractUIPlugin.imageDescriptorFromPlugin(FindbugsPlugin.getDefault().getBundle()
            .getSymbolicName(), imagePath));
    setDescription(descr);
}
 
Example 7
Source File: NewDataflowProjectWizardLandingPage.java    From google-cloud-eclipse with Apache License 2.0 4 votes vote down vote up
private static ImageDescriptor getDataflowIcon() {
  String imageFilePath = "icons/Dataflow_64.png"; //$NON-NLS-1$
  return AbstractUIPlugin.imageDescriptorFromPlugin(
      "com.google.cloud.tools.eclipse.dataflow.ui", imageFilePath); //$NON-NLS-1$
}
 
Example 8
Source File: StatsResources.java    From depan with Apache License 2.0 4 votes vote down vote up
private static ImageDescriptor getImageDescriptor(String path) {
  return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 9
Source File: ViewDocResources.java    From depan with Apache License 2.0 4 votes vote down vote up
private static ImageDescriptor getImageDescriptor(String path) {
  return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 10
Source File: NodeListResources.java    From depan with Apache License 2.0 4 votes vote down vote up
private static ImageDescriptor getImageDescriptor(String path) {
  return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 11
Source File: RemapResources.java    From depan with Apache License 2.0 4 votes vote down vote up
private static ImageDescriptor getImageDescriptor(String path) {
  return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 12
Source File: AbstractChartView.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
public EditorAction ()
{
    super ( "Show editor", AbstractUIPlugin.imageDescriptorFromPlugin ( Activator.PLUGIN_ID, "icons/editchart.png" ) ); //$NON-NLS-2$
    setDescription ( "Show the chart model editor view" );
    setToolTipText ( "Show the chart model editor view" );
}
 
Example 13
Source File: AbstractChartView.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
public ControllerAction ()
{
    super ( "Show controller", AbstractUIPlugin.imageDescriptorFromPlugin ( Activator.PLUGIN_ID, "icons/chartController.gif" ) ); //$NON-NLS-2$
    setDescription ( "Show the chart controller view" );
    setToolTipText ( "Show the chart controller view" );
}
 
Example 14
Source File: Activator.java    From tracecompass with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * Gets an image descriptor using given path within plug-in.
 *
 * @param path path to image file
 *
 * @return image descriptor object
 */
public ImageDescriptor getImageDescripterFromPath(String path) {
    return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 15
Source File: Activator.java    From tracecompass with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * Get the ImageDescriptor from a given path
 *
 * @param path
 *            The path to the image file
 * @return The ImageDescriptor object
 */
public ImageDescriptor getImageDescripterFromPath(String path) {
    return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 16
Source File: SVGPlugin.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * getImageDescriptor
 * 
 * @param path
 * @return
 */
public static ImageDescriptor getImageDescriptor(String path)
{
	return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 17
Source File: Activator.java    From tracecompass with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * Get the ImageDescriptor from a given path
 *
 * @param path
 *            The path to the image file
 * @return The ImageDescriptor object
 */
public ImageDescriptor getImageDescripterFromPath(String path) {
    return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 18
Source File: CSSPlugin.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * getImageDescriptor
 * 
 * @param path
 * @return
 */
public static ImageDescriptor getImageDescriptor(String path)
{
	return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 19
Source File: Activator.java    From neoscada with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Returns an image descriptor for the image file at the given
 * plug-in relative path.
 *
 * @param path the path
 * @return the image descriptor
 */
public static ImageDescriptor getImageDescriptor ( final String path )
{
    return AbstractUIPlugin.imageDescriptorFromPlugin ( "org.eclipse.scada.da.ui.client.test", path );
}
 
Example 20
Source File: Activator.java    From tracecompass with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * Gets an image descriptor using given path within plug-in.
 *
 * @param path
 *            path to image file
 *
 * @return image descriptor object
 */
public ImageDescriptor getImageDescripterFromPath(String path) {
    return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}