public static Image getImage(AbstractUIPlugin plugin, String path) {
   ImageRegistry registry = plugin.getImageRegistry();
   Image image = registry.get(path);
   if (image == null) {
     ImageDescriptor id = getImageDescriptor(plugin.getBundle().getSymbolicName(), path);
     if (id == null) {
       return null;
     }
     registry.put(path, id);
     image = registry.get(path);
   }
   return image;
 }
Exemple #2
0
 /**
  * Finds and caches the iamge from the image descriptor for this particular plugin.
  *
  * @param plugin the plugin to search
  * @param path the path to the image
  * @return the image, or null if not found
  */
 public static Image getImage(AbstractUIPlugin plugin, String path) {
   return getImage(plugin.getBundle(), path);
 }