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:cn.dockerfoundry.ide.eclipse.server.ui.internal.DockerFoundryImages.java

License:Open Source License

public static ImageDescriptor create(String prefix, String name) {
    try {/* w  w  w.ja  v a 2 s.  co m*/
        return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
    } catch (MalformedURLException e) {
        return ImageDescriptor.getMissingImageDescriptor();
    }
}

From source file:com.aljoschability.rendis.ui.runtime.ActivatorImpl.java

License:Open Source License

protected final void addImage(String key, String path) {
    ImageDescriptor descriptor = getImageRegistry().getDescriptor(key);
    if (descriptor != null) {
        warn(String.format("An image with the key '%1s' has already been added to the registry.", key));
        return;//  www .j  av a  2s.c  om
    }

    descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(getSymbolicName(), path);
    if (descriptor == null || ImageDescriptor.getMissingImageDescriptor().equals(descriptor)) {
        warn(String.format("The image under the path '%1s' could not be found.", path));
        return;
    }

    getImageRegistry().put(key, descriptor);
}

From source file:com.aljoschability.rendis.ui.runtime.ActivatorImpl.java

License:Open Source License

private ImageRegistry getImageRegistry() {
    if (imageRegistry == null) {
        imageRegistry = new ImageRegistry(getDisplay());
        imageRegistry.put(null, ImageDescriptor.getMissingImageDescriptor());
    }/*w w  w. jav a 2s .  c  om*/
    return imageRegistry;
}

From source file:com.amalto.workbench.providers.XObjectBrowserInput.java

License:Open Source License

public ImageDescriptor getImageDescriptor() {
    return ImageDescriptor.getMissingImageDescriptor();
    // FIXME: Must Return an image to editors for Xtentits objects
}

From source file:com.aptana.ide.core.ui.CoreUIUtils.java

License:Open Source License

/**
 * Retrieves the image descriptor associated with resource from the image descriptor registry. If the image
 * descriptor cannot be retrieved, attempt to find and load the image descriptor at the location specified in
 * resource.//from w w w  .  ja  v a2 s. c om
 * 
 * @param pluginId
 *            the Id of the plug-in to grab the image from
 * @param imageFilePath
 *            the image descriptor to retrieve
 * @return The image descriptor associated with resource or the default "missing" image descriptor if one could not
 *         be found
 */
public static ImageDescriptor getImageDescriptor(String pluginId, String imageFilePath) {
    ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, imageFilePath);

    if (imageDescriptor == null) {
        imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
    }

    return imageDescriptor;
}

From source file:com.aptana.ide.core.ui.ImageUtils.java

License:Open Source License

/**
 * Retrieves the image descriptor associated with resource from the image descriptor registry. If the image
 * descriptor cannot be retrieved, attempt to find and load the image descriptor at the location specified in
 * resource./*from   ww w.  j a va 2s.  c om*/
 * 
 * @param imageFilePath
 *            the image descriptor to retrieve
 * @return The image descriptor associated with resource or the default "missing" image descriptor if one could not
 *         be found
 */
public static ImageDescriptor getImageDescriptor(String imageFilePath) {
    ImageDescriptor imageDescriptor = CoreUIPlugin.getImageDescriptor(imageFilePath);

    if (imageDescriptor == null) {
        imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
    }

    return imageDescriptor;
}

From source file:com.aptana.ide.debug.internal.ui.DebugUIImages.java

License:Open Source License

/**
 * Declare an Image in the registry table.
 * //from  ww  w.  j a  v a2  s .co  m
 * @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)
 */
private static void declareRegistryImage(String key, String path) {
    ImageDescriptor desc = ImageDescriptor.getMissingImageDescriptor();
    Bundle bundle = Platform.getBundle(DebugUiPlugin.getUniqueIdentifier());
    URL url = null;
    if (bundle != null) {
        url = FileLocator.find(bundle, new Path(path), null);
        desc = ImageDescriptor.createFromURL(url);
    }
    fgImageRegistry.put(key, desc);
}

From source file:com.aptana.ide.editor.scriptdoc.contentassist.ScriptDocContentAssistProcessor.java

License:Open Source License

/**
 * Retrieves the image descriptor associated with resource from the image
 * descriptor registry. If the image descriptor cannot be retrieved, attempt
 * to find and load the image descriptor at the location specified in
 * resource.//  w ww .jav  a2s .c o m
 * 
 * @param imageFilePath
 *            the image descriptor to retrieve
 * @return The image descriptor associated with resource or the default
 *         "missing" image descriptor if one could not be found
 */
private static ImageDescriptor getImageDescriptor(String imageFilePath) {
    ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin("com.aptana.ide.editors", //$NON-NLS-1$
            imageFilePath);

    if (imageDescriptor == null) {
        imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
    }

    return imageDescriptor;
}

From source file:com.aptana.ide.editors.views.actions.ActionsView.java

License:Open Source License

/**
 * Retrieves the image descriptor associated with resource from the image descriptor registry. If the image
 * descriptor cannot be retrieved, attempt to find and load the image descriptor at the location specified in
 * resource.//from  w  w  w  .j  a  va2s  .  c  om
 * 
 * @param imageFilePath
 *            the image descriptor to retrieve
 * @return The image descriptor assocated with resource or the default "missing" image descriptor if one could not
 *         be found
 */
private static ImageDescriptor getImageDescriptor(String imageFilePath) {
    ImageDescriptor imageDescriptor = UnifiedEditorsPlugin.getImageDescriptor(imageFilePath);

    if (imageDescriptor == null) {
        imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
    }

    return imageDescriptor;
}

From source file:com.aptana.ide.installer.views.PluginImages.java

License:Open Source License

/**
 * Declare an Image in the registry table.
 * //from  www  .jav a  2s.c om
 * @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)
 */
private final static void declareRegistryImage(String key, String path) {
    ImageDescriptor desc = ImageDescriptor.getMissingImageDescriptor();
    Bundle bundle = Activator.getDefault().getBundle();
    if (bundle != null) {
        URL url = FileLocator.find(bundle, new Path(path), null);
        desc = ImageDescriptor.createFromURL(url);
    }
    imageRegistry.put(key, desc);
}