Examples of ImageRegistry


Examples of org.eclipse.jface.resource.ImageRegistry

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

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

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

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

    opId = "Load"; //$NON-NLS-1$
    imgFile = "image/folder.png"; //$NON-NLS-1$
    registry.put(opId, ImageDescriptor.createFromFile(ImageComposite.class, imgFile));

    opId = "Add"; //$NON-NLS-1$
    imgFile = "image/placemark_pointer2.gif"; //$NON-NLS-1$
    registry.put(opId, ImageDescriptor.createFromFile(ImageComposite.class, imgFile));

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

    opId = "ZoomIn"; //$NON-NLS-1$
    imgFile = "image/zoom-in-5.png"; //$NON-NLS-1$
    registry.put(opId, ImageDescriptor.createFromFile(ImageComposite.class, imgFile));

    opId = "ZoomOut"; //$NON-NLS-1$
    imgFile = "image/zoom-out-5.png"; //$NON-NLS-1$
    registry.put(opId, ImageDescriptor.createFromFile(ImageComposite.class, imgFile));

    opId = "ZoomFit"; //$NON-NLS-1$
    imgFile = "image/zoom_extent.gif"; //$NON-NLS-1$
    registry.put(opId, ImageDescriptor.createFromFile(ImageComposite.class, imgFile));

    opId = "Pan"; //$NON-NLS-1$
    imgFile = "image/pan.png"; //$NON-NLS-1$
    registry.put(opId, ImageDescriptor.createFromFile(ImageComposite.class, imgFile));

    return registry;
  }
View Full Code Here

Examples of org.eclipse.jface.resource.ImageRegistry

        public Image getImage(Object object) {
          UDIGConnectionFactoryDescriptor descriptor = (UDIGConnectionFactoryDescriptor) object;

          String id = descriptor.getId();
          ImageRegistry registry = UiPlugin.getDefault()
              .getImageRegistry();
          ImageDescriptor image = descriptor.getImage(0);
          synchronized (registry) {
              if (registry.get(id) == null && image != null) {
                  registry.put(id, image);
              }

          return registry.get(id);
          }
        }
      });
    }
View Full Code Here

Examples of org.eclipse.jface.resource.ImageRegistry

   
    @Override
    public void createPartControl( Composite aParent ) {
        super.createPartControl(aParent);
        ApplicationGIS.getToolManager().registerActionsWithPart(this);
        registry = new ImageRegistry( aParent.getDisplay() );       
    }
View Full Code Here

Examples of org.eclipse.jface.resource.ImageRegistry

            if (data == null)
                return null;
        }

        // look image up in registry to see if it is already loaded
        ImageRegistry imageRegistry = CatalogUIPlugin.getDefault().getImageRegistry();
        Image i;
        synchronized (imageRegistry) {
            i = imageRegistry.get(resolve.getIdentifier().toString());
            // if it is loaded and not disposed then we're good, return it.
            if( i!=null && !i.isDisposed()){
                return i;
            }
           
            if (i!=null && i.isDisposed() )
                imageRegistry.remove(resolve.getIdentifier().toString());
        }
       
        // we tried to look up a cached version... If not around and viewer doesn't want decorated images then we'll return.
       
        if( !resolve.getID().isLocal() && !decorateImages ){
View Full Code Here

Examples of org.eclipse.jface.resource.ImageRegistry

            }
        }

        private Image creatImage( LabelData data, final IResolve element ) throws IOException {
            String key = element.getIdentifier().toString();
            ImageRegistry imageRegistry = CatalogUIPlugin.getDefault().getImageRegistry();
            // need to protect the items put in the image registry
            // in addition to availableImageWorkers
            Image i;
            synchronized (imageRegistry) {
                i = imageRegistry.get(key);
            }
            if (i==null || i.isDisposed()){
                data.image = CatalogUIPlugin.icon(element);
                imageDescriptorCache.put(element, data.image);
                try{
                    if( data.image!=null)
                        i = data.image.createImage();
                }catch (Throwable e) {
                    CatalogUIPlugin.log("Error creating the Image for the resource", e); //$NON-NLS-1$
                }
            }else{
                data.image=imageDescriptorCache.get(element);// get cached
            }
            if( i==null )
                i=CatalogUIPlugin.image(element);
            synchronized (imageRegistry) {
                Image i2 = imageRegistry.get(key);
                if( i2!=null && !i2.isDisposed()){
                    return i;
                }
               
                if (i2!=null && i2.isDisposed() )
                    imageRegistry.remove(key);
               
                imageRegistry.put(key, i);
            }
            return i;
        }
View Full Code Here

Examples of org.eclipse.jface.resource.ImageRegistry

                public Image getImage(Object object) {
                    ExternalCatalogueImportDescriptor descriptor =
                            (ExternalCatalogueImportDescriptor) object;

                    String id = descriptor.getID();
                    ImageRegistry registry = UiPlugin.getDefault()
                            .getImageRegistry();
                    ImageDescriptor image = descriptor.getIcon();
                    synchronized (registry) {
                        if (registry.get(id) == null && image != null) {
                            registry.put(id, image);
                        }
                       
                        return registry.get(id);
                    }
                }
            });
        }
View Full Code Here

Examples of org.eclipse.jface.resource.ImageRegistry

        final Button button = new Button(composite, SWT.PUSH | SWT.FLAT);
        GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
        button.setLayoutData(data);
        button.setToolTipText(action.getToolTipText());

        ImageRegistry images = UiPlugin.getDefault().getImageRegistry();
        Image image = images.get(action.getId());
        if (image == null || image.isDisposed()) {
            images.put(action.getId(), action.getImageDescriptor());
            image = images.get(action.getId());
        }
        button.setImage(image);

        button.addListener(SWT.Selection, new Listener(){
            public void handleEvent( Event event ) {
View Full Code Here

Examples of org.eclipse.jface.resource.ImageRegistry

        java.util.Map<String, TemplateFactory> templateFactories = plugin.getTemplateFactories();
       
        setWindowTitle(Messages.ExportPDFWizard_Title);
       
        String key = Icons.WIZBAN +"exportpdf_wiz.gif"; //$NON-NLS-1$
        ImageRegistry imageRegistry = plugin.getImageRegistry();       
        ImageDescriptor image = imageRegistry.getDescriptor( key );
        if( image == null ){
            URL banURL = plugin.getBundle().getResource( "icons/" + key ); //$NON-NLS-1$
            image = ImageDescriptor.createFromURL( banURL );
            imageRegistry.put( key, image );
        }
        setDefaultPageImageDescriptor( image );       
       
        //get copy of map
        IEditorInput input = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
View Full Code Here

Examples of org.eclipse.jface.resource.ImageRegistry

        label.setText(labelText);

        final Text text = new Text(parent, textStyle);

        final ControlDecoration decoration = new ControlDecoration(text, SWT.TOP | SWT.LEFT);
        ImageRegistry imageRegistry = CatalogUIPlugin.getDefault().getImageRegistry();
        Image image = imageRegistry.get(REQUIRED_DECORATION);
        if (image == null) {
            image = CatalogUIPlugin.getDefault().getImageDescriptor(ISharedImages.WARNING_OVR).createImage();
            imageRegistry.put(REQUIRED_DECORATION, image);
        }
        decoration.setImage(image);
        decoration.setDescriptionText(localization.requiredField);
        decoration.show();
View Full Code Here

Examples of org.eclipse.jface.resource.ImageRegistry

        return registry.get("trash"); //$NON-NLS-1$
    }

    private void createImageRegistry() {

        registry = new ImageRegistry();

        String imgFile = "images/" + "trash" + ".gif"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        registry.put("trash", ImageDescriptor.createFromFile(MergeComposite.class, imgFile)); //$NON-NLS-1$
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.