示例#1
0
  /**
   * Returns an image descriptor.
   *
   * @return an {@link ImageDescriptor}
   */
  public ImageDescriptor imageDescriptor() {
    final ImageRegistry imageRegistry = DiagramActivator.getDefault().getImageRegistry();
    ImageDescriptor imageDescriptor = imageRegistry.getDescriptor(path);
    if (imageDescriptor == null) {
      addImageDescriptor();
      imageDescriptor = imageRegistry.getDescriptor(path);
    }

    return imageDescriptor;
  }
示例#2
0
 private void addImageDescriptor() {
   final DiagramActivator plugin = DiagramActivator.getDefault();
   final ImageDescriptor id = ImageDescriptor.createFromURL(plugin.getBundle().getEntry(path));
   plugin.getImageRegistry().put(path, id);
 }