44291

How to get icons for entities from eclipse?

I am writing an eclipse plugin. How do I get the various images from eclipse library? So I don't have have keep a local set of images for the standard entities, e.g classes, interfaces, junits, etc.

<strong>EDIT :</strong> I used PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE) from the article : http://www.eclipse.org/articles/Article-Using%20Images%20In%20Eclipse/Using%20Images%20In%20Eclipse.html. That did not work.

Answer1:

The code is correct (AFAIK), but not all Shared Images are available like that. I suggest experimenting with various constants (e.g. IMG_ELCL_REMOVEALL works in a project of mine).

Answer2:

You can do it like this method:

public Image getImage() { ImageDescriptor descriptor = Activator.getImageDescriptor("$nl$/icons/xxx.png"); return descriptor.createImage(); }

Answer3:

You can use Image browser view. See here Refer this post for using eclipse standard images/icons in your plugin

Recommend

  • Open file to a certain line in Eclipse plugin
  • How to get a Workspace's working sets information in a plugin?
  • Open file to a certain line in Eclipse plugin
  • Using “await” in a converter (IValueConverter) not working?
  • Add and display a new FormPage to a FormEditor using a command
  • Display blob image in html with angularjs
  • rename keys in a dictionary
  • Compare Date & Time Javascript
  • C# dynamic support?
  • Javascript and VERY LONG string
  • overhead of reserving address space using mmap
  • How to hide header on specific page in wordpress
  • Configuration class - Get configuration array from the function string argument
  • Android Studio 2.0 - this version of Android Studio is incompatible with the Gradle Plugin used. Try
  • Escape exclamation mark in batch file
  • SQL how to do an outer join properly
  • Quickly find the min and max coordinates of connected component in a large image
  • Displaying image retrieved from database to image control
  • Fast way to alphabetically sort the contents of a file in java
  • K-means in OpenCV's Python interface
  • Waiting for $.post to finish
  • What dll is needed for Windows.Devices.Geolocation?
  • SQL append distinct values from two columns and two tables
  • HALF_PTR Windows data type
  • date format change with DT and shiny
  • How do I translate LR(1) Parse into a Abstract syntax tree?
  • JQuery .html() remove line break on IE 8
  • Why does it draw lines in the wrong place?
  • SQL Query - Table Joining Problems
  • bad substitution shell- trying to use variable as name of array
  • converting text file into xml using php?
  • How to run “Deployd” on port 80 instead of port 5000 in webserver.
  • Android full screen on only one activity?
  • Resize panoramic image to fixed size
  • Weird JavaScript statement, what does it mean?
  • Python - Map / Reduce - How do I read JSON specific field in using DISCO count words example
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • bootstrap to use multiple ng-app
  • Turn off referential integrity in Derby? is it possible?
  • JaxB to read class hierarchy