Package org.eclipse.jface.resource

Examples of org.eclipse.jface.resource.ImageRegistry


    }
    return registry.get(path);
  }

  public static ImageDescriptor getSharedDescriptor(String path) {
    ImageRegistry registry = getDefault().getImageRegistry();
    ImageDescriptor image_descriptor = registry.getDescriptor(path);
    if (image_descriptor == null) {
      image_descriptor = getImageDescriptor(path);
      registry.put(path, image_descriptor);
    }
    return image_descriptor;
  }
View Full Code Here


    return image_descriptor;
  }

  public static Image getSharedImage(String pluginId, String path) {
    String iconKey = pluginId + path;
    ImageRegistry registry = getDefault().getImageRegistry();
    ImageDescriptor image_descriptor = registry.getDescriptor(iconKey);
    if (image_descriptor == null) {
      Bundle bundle = Platform.getBundle(pluginId);
      image_descriptor = ImageDescriptor.createFromURL(bundle.getResource(path));
      registry.put(iconKey, image_descriptor);
    }
    return registry.get(iconKey);
  }
View Full Code Here

     * @return the image descriptor
     */
    public static ImageDescriptor getImageDescriptor(String path) {

        DroolsEclipsePlugin plugin = getDefault();
        ImageRegistry reg = plugin.getImageRegistry();
        ImageDescriptor des = reg.getDescriptor( path );
        if ( des == null ) {
            des = AbstractUIPlugin.imageDescriptorFromPlugin( "org.drools.eclipse",
                                                              path );
            reg.put( path,
                     des );
        }
        return des;
    }
View Full Code Here

     */
    protected ImageRegistry createImageRegistry() {
     
      //If we are in the UI Thread use that
      if(Display.getCurrent() != null) {
      return new ImageRegistry(Display.getCurrent());
    }
     
      if(PlatformUI.isWorkbenchRunning()) {
      return new ImageRegistry(PlatformUI.getWorkbench().getDisplay());
    }
     
      //Invalid thread access if it is not the UI Thread
      //and the workbench is not created.
      throw new SWTError(SWT.ERROR_THREAD_INVALID_ACCESS);
View Full Code Here

     *      The images are declared using this.getClass() to ensure they are looked up via
     *      this plugin class.
     *  @see ImageRegistry
     */
    private static void initializeImageRegistry() {
        imageRegistry = new ImageRegistry();
        descriptors = new HashMap();
        declareImages();
    }
View Full Code Here

  }

  public static synchronized ImageRegistry getImageRegistry() {
    if (Activator.getDefault() == null) {
            if (imageRegistry == null) {
                imageRegistry = new ImageRegistry();
                initImageRegistry(imageRegistry);
            }
            return imageRegistry;
    }
    return Activator.getDefault().getImageRegistry();
View Full Code Here

  protected ImageDescriptor getImageDescriptor(String key) {
    return loadImage(key).getDescriptor(key);
  }

  protected ImageRegistry loadImage(String path) {
    ImageRegistry reg = getActivator().getImageRegistry();
    if (reg.getDescriptor(path) == null) {
      URL url = getActivator().getBundle().getEntry(path);
      reg.put(path, ImageDescriptor.createFromURL(url));
    }
    return reg;
  }
View Full Code Here

        //enable the save/restore windows size & position feature
        configurer.setSaveAndRestore( true );

        //enable help button in dialogs
        TrayDialog.setDialogHelpAvailable( true );
        ImageRegistry reg = JFaceResources.getImageRegistry();
        ImageDescriptor helpImage = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
            ISharedImages.IMG_LCL_LINKTO_HELP );
        reg.put( Dialog.DLG_IMG_HELP, helpImage );
    }
View Full Code Here

     * @return the image descriptor
     */
    public static ImageDescriptor getImageDescriptor(String path) {

        DroolsEclipsePlugin plugin = getDefault();
        ImageRegistry reg = plugin.getImageRegistry();
        ImageDescriptor des = reg.getDescriptor( path );
        if ( des == null ) {
            des = AbstractUIPlugin.imageDescriptorFromPlugin( "org.drools.eclipse",
                                                              path );
            reg.put( path,
                     des );
        }
        return des;
    }
View Full Code Here

   *
   * @return The imageRegistry.
   */
  private ImageRegistry createImageRegistry() {

    ImageRegistry registry = new ImageRegistry(this.getDisplay());

    String opId = "Delete"; //$NON-NLS-1$
    String imgFile = "image/delete.gif"; //$NON-NLS-1$
    registry.put(opId, ImageDescriptor.createFromFile(CoordinateTableComposite.class, imgFile));

    opId = "Add"; //$NON-NLS-1$
    imgFile = "image/add.png"; //$NON-NLS-1$
    registry.put(opId, ImageDescriptor.createFromFile(CoordinateTableComposite.class, imgFile));

    opId = "Move"; //$NON-NLS-1$
    imgFile = "image/movemarker.png"; //$NON-NLS-1$
    registry.put(opId, ImageDescriptor.createFromFile(CoordinateTableComposite.class, imgFile));

    opId = "DeleteAll"; //$NON-NLS-1$
    imgFile = "image/deleteAll.gif"; //$NON-NLS-1$
    registry.put(opId, ImageDescriptor.createFromFile(CoordinateTableComposite.class, imgFile));

    return registry;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.resource.ImageRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.