Example usage for org.eclipse.jface.resource ImageDescriptor getMissingImageDescriptor

List of usage examples for org.eclipse.jface.resource ImageDescriptor getMissingImageDescriptor

Introduction

In this page you can find the example usage for org.eclipse.jface.resource ImageDescriptor getMissingImageDescriptor.

Prototype

public static ImageDescriptor getMissingImageDescriptor() 

Source Link

Document

Returns the shared image descriptor for a missing image.

Usage

From source file:org.peprframework.ide.model.TransitionFactory.java

License:Apache License

public ImageDescriptor getSmallIcon() {
    return ImageDescriptor.getMissingImageDescriptor();
}

From source file:org.peprframework.ide.model.TransitionFactory.java

License:Apache License

public ImageDescriptor getLargeIcon() {
    return ImageDescriptor.getMissingImageDescriptor();
}

From source file:org.peprframework.ide.parts.ActivityEditPart.java

License:Apache License

@Override
protected IFigure createFigure() {
    ActivityRegistry registry = Activator.getDefault().getActivityRegistry();
    ImageDescriptor descr = registry.getProcessIconImageDescriptor(((Activity) getModel()).getId());
    if (descr == null) {
        descr = ImageDescriptor.getMissingImageDescriptor();
    }//from ww  w.  j  a v  a2s .  c om

    Image image = descr.createImage();
    String name = registry.getName(((Activity) getModel()).getId());
    String text = ((Activity) getModel()).getName();
    NamedLabel figure = new NamedLabel(image, name, text);
    figure.setIconAlignment(PositionConstants.CENTER);
    figure.setTextPlacement(PositionConstants.SOUTH);
    figure.setTextAlignment(PositionConstants.CENTER);

    Point location = new Point(((Activity) getModel()).getLocation().getX(),
            ((Activity) getModel()).getLocation().getY());
    figure.setBounds(
            new Rectangle(location, new Dimension(image.getBounds().width, image.getBounds().height + 50)));
    figure.setLocation(location);
    return figure;
}

From source file:org.peprframework.ide.views.pages.input.InputSourceLabelProvider.java

License:Apache License

public Image getImage(Object element) {
    return ImageDescriptor.getMissingImageDescriptor().createImage();
}

From source file:org.peprframework.ide.wizards.NewProcessWizard.java

License:Apache License

public void init(IWorkbench workbench, IStructuredSelection selection) {
    this.workbench = workbench;
    this.selection = selection;

    setWindowTitle("New Process");
    setDefaultPageImageDescriptor(ImageDescriptor.getMissingImageDescriptor());
    setNeedsProgressMonitor(true);// w w w.jav  a  2 s.c  o m
}

From source file:org.projectusus.autotestsuite.ui.internal.util.AutoTestSuiteUIImages.java

License:Open Source License

private void declare(final String key, final String path) {
    ImageDescriptor desc = ImageDescriptor.getMissingImageDescriptor();
    try {//from ww w .j  a v a 2 s.c o m
        desc = ImageDescriptor.createFromURL(makeIconFileURL(path));
    } catch (MalformedURLException exception) {
        log(exception);
    }
    imageRegistry.put(key, desc);
}

From source file:org.projectusus.ui.colors.UsusUIImages.java

License:Open Source License

private void declare(final String key, final String path) {
    ImageDescriptor desc = ImageDescriptor.getMissingImageDescriptor();
    try {//from  ww w  .jav  a2s  . c o  m
        desc = ImageDescriptor.createFromURL(makeIconFileURL(path));
    } catch (MalformedURLException malfux) {
        UsusUIPlugin.getDefault().log(malfux);
    }
    imageRegistry.put(key, desc);
}

From source file:org.python.pydev.core.bundle.ImageCache.java

License:Open Source License

/**
 * @param key - relative path to the plugin directory
 * @return the image//from ww  w  .  jav  a  2  s  .  c o m
 */
public Image get(String key) {
    synchronized (lock) {
        Image image = (Image) imageHash.get(key);
        if (image == null) {
            ImageDescriptor desc;
            try {
                desc = getDescriptor(key);
                image = desc.createImage();
                imageHash.put(key, image);
            } catch (NoClassDefFoundError e) {
                //we're in tests...
                return null;
            } catch (UnsatisfiedLinkError e) {
                //we're in tests...
                return null;
            } catch (Exception e) {
                // If image is missing, create a default missing one
                Log.log("ERROR: Missing image: " + key);
                if (missing == null) {
                    desc = ImageDescriptor.getMissingImageDescriptor();
                    missing = desc.createImage();
                }
                image = missing;
            }
        }
        return image;
    }
}

From source file:org.raspinloop.fmi.plugin.Images.java

License:Open Source License

/**
  * Declare an Image in the registry table.
  * @param key   The key to use when registering the image
  * @param path  The path where the image can be found. This path is relative to where
  *              this plugin class is found (i.e. typically the packages directory)
  *//*from ww w .j  a  va2 s.co m*/
private final static void declareRegistryImage(String key, String path) {
    ImageDescriptor desc = ImageDescriptor.getMissingImageDescriptor();
    Bundle bundle = Platform.getBundle("org.raspinloop.fmi.plugin.fmi");
    URL url = null;
    if (bundle != null) {
        url = FileLocator.find(bundle, new Path(path), null);
        if (url != null) {
            desc = ImageDescriptor.createFromURL(url);
        }
    }
    fgImageRegistry.put(key, desc);
}

From source file:org.reuseware.application.taipan.figures.ShipShape.java

License:Open Source License

protected Image getImageImage(String path) {
    Image image = JFaceResources.getImageRegistry().get(path);
    if (image == null) {
        ImageDescriptor descriptor = AbstractUIPlugin
                .imageDescriptorFromPlugin("org.reuseware.application.taipan", path); //$NON-NLS-1$
        if (descriptor == null) {
            descriptor = ImageDescriptor.getMissingImageDescriptor();
        }//from  w  w  w  .j  av  a  2 s  .c  om
        JFaceResources.getImageRegistry().put(path, image = descriptor.createImage());
    }
    return image;
}