Package org.eclipse.jface.resource

Examples of org.eclipse.jface.resource.LocalResourceManager


   *
   * @return The resource manager, create one if necessary
   */
  private ResourceManager getResourceManager() {
    if (resourceManager == null) {
      resourceManager = new LocalResourceManager(JFaceResources
          .getResources());
    }

    return resourceManager;
  }
View Full Code Here


        setTitle( "New Knowledge Baset" );
        setDescription( "Create a new Knowledge Base" );
        this.workbench = workbench;
        this.selection = selection;

        resourceManager = new LocalResourceManager( JFaceResources.getResources() );
    }
View Full Code Here

  /**
   * Create a new instance of this class.
   */
  public ActivityCategoryLabelProvider() {
    manager = new LocalResourceManager(JFaceResources.getResources());
  }
View Full Code Here

 
  public boolean markFinished(Font boldFont, Display display) {
    checkHashMaps();
    BoldFontDescriptor desc = (BoldFontDescriptor)descriptors.get(boldFont);
    if (desc != null) {
      LocalResourceManager resourceManager = manager.getResourceManager(display);
      resourceManager.destroyFont(desc);
      if (resourceManager.find(desc) == null) {
        descriptors.remove(boldFont);
        validateHashMaps();
      }
      return true;
     
View Full Code Here

  public LocalResourceManager getResourceManager(Display display) {
    if (resourceManagers == null) {
      resourceManagers = new HashMap();
    }
    LocalResourceManager resources = (LocalResourceManager)resourceManagers.get(display);
    if (resources == null) {
      pruneResourceManagers();
      resources = new LocalResourceManager(JFaceResources.getResources(display));
      resourceManagers.put(display, resources);
    }
    return resources;
  }
View Full Code Here

 
  public synchronized boolean markFinished(Image image, Display display) {
    checkHashMaps();
    AbstractImageDescriptor desc = (AbstractImageDescriptor)descriptors.get(image);
    if (desc != null) {
      LocalResourceManager resourceManager = manager.getResourceManager(display);
      resourceManager.destroyImage(desc);
      if (resourceManager.find(desc) == null) {
        descriptors.remove(image);
        validateHashMaps();
      }
      return true;
    }
View Full Code Here

    createColor(IFormColors.H_HOVER_FULL, full);
  }
 
  private LocalResourceManager getResourceManager() {
    if (resources == null)
      resources = new LocalResourceManager(JFaceResources.getResources());
    return resources;
  }
View Full Code Here

      public void dispose() {
      }
    });
    workingsetComboViewer.setLabelProvider(new LabelProvider() {
      private ResourceManager images = new LocalResourceManager(JFaceResources.getResources());

      @SuppressWarnings("deprecation")
      public Image getImage(Object element) {
        if(element instanceof IWorkingSet) {
          ImageDescriptor imageDescriptor = ((IWorkingSet) element).getImage();
          if(imageDescriptor != null) {
            try {
              return (Image) images.create(imageDescriptor);
            } catch(DeviceResourceException ex) {
              return null;
            }
          }
        }
        return super.getImage(element);
      }

      public String getText(Object element) {
        if(element instanceof IWorkingSet) {
          return ((IWorkingSet) element).getLabel();
        } else if(element instanceof List<?>) {
          StringBuffer sb = new StringBuffer();
          for(Object o : (List<?>) element) {
            if(o instanceof IWorkingSet) {
              if(sb.length() > 0) {
                sb.append(", "); //$NON-NLS-1$
              }
              sb.append(((IWorkingSet) o).getLabel());
            }
          }
          return sb.toString();
        }
        return super.getText(element);
      }

      public void dispose() {
        images.dispose();
        super.dispose();
      }
    });

    workingsetComboViewer.setComparator(new ViewerComparator());
View Full Code Here

            if (text != null) {
                menuItem.setText(text);
            }

            if (image != null) {
                LocalResourceManager localManager = new LocalResourceManager(JFaceResources.getResources());
                menuItem.setImage(localManager.createImage(image));
                disposeOldImages();
                imageManager = localManager;
            }

            if (!menuExist()) {
View Full Code Here

                    }

                    menu.getParentItem().setText(text);
                }
            } else if (IAction.IMAGE.equals(property) && image != null) {
                LocalResourceManager localManager = new LocalResourceManager(JFaceResources.getResources());
                menu.getParentItem().setImage(localManager.createImage(image));
                disposeOldImages();
                imageManager = localManager;
            }
        }
    }
View Full Code Here

TOP

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

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.