Java 类org.eclipse.jface.resource.ImageRegistry 实例源码

项目:n4js    文件:TesterUiActivator.java   
@Override
protected void initializeImageRegistry(ImageRegistry reg) {
    reg.put(ICON_TEST, imageDescriptor(ICON_TEST));
    reg.put(ICON_TEST_SKIPPED, imageDescriptor(ICON_TEST_SKIPPED));
    reg.put(ICON_TEST_PASSED, imageDescriptor(ICON_TEST_PASSED));
    reg.put(ICON_TEST_SKIPPED_NOT_IMPLEMENTED_YET, imageDescriptor(ICON_TEST_SKIPPED_NOT_IMPLEMENTED_YET));
    reg.put(ICON_TEST_FAILED, imageDescriptor(ICON_TEST_FAILED));
    reg.put(ICON_TEST_ERROR, imageDescriptor(ICON_TEST_ERROR));
    reg.put(ICON_TEST_RUNNING, imageDescriptor(ICON_TEST_RUNNING));
    reg.put(ICON_SUITE, imageDescriptor(ICON_SUITE));
    reg.put(ICON_SUITE_SKIPPED, imageDescriptor(ICON_SUITE_SKIPPED));
    reg.put(ICON_SUITE_PASSED, imageDescriptor(ICON_SUITE_PASSED));
    reg.put(ICON_SUITE_FAILED, imageDescriptor(ICON_SUITE_FAILED));
    reg.put(ICON_SUITE_ERROR, imageDescriptor(ICON_SUITE_ERROR));
    reg.put(ICON_SUITE_RUNNING, imageDescriptor(ICON_SUITE_RUNNING));
    reg.put(ICON_SUITE, imageDescriptor(ICON_SUITE));
    reg.put(ICON_LOCK, imageDescriptor(ICON_LOCK));
    reg.put(ICON_RELAUNCH, imageDescriptor(ICON_RELAUNCH));
    reg.put(ICON_RELAUNCH_FAILED, imageDescriptor(ICON_RELAUNCH_FAILED));
    reg.put(ICON_STOP, imageDescriptor(ICON_STOP));
    reg.put(ICON_HISTORY, imageDescriptor(ICON_HISTORY));
}
项目:eclipse-batch-editor    文件:EclipseUtil.java   
/**
 * Get image by path from image registry. If not already registered a new
 * image will be created and registered. If not createable a fallback image
 * is used instead
 * 
 * @param path
 * @param pluginId
 *            - plugin id to identify which plugin image should be loaded
 * @return image
 */
public static Image getImage(String path, String pluginId) {
    ImageRegistry imageRegistry = getImageRegistry();
    if (imageRegistry == null) {
        return null;
    }
    Image image = imageRegistry.get(path);
    if (image == null) {
        ImageDescriptor imageDesc = createImageDescriptor(path, pluginId);
        image = imageDesc.createImage();
        if (image == null) {
            image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
        }
        imageRegistry.put(path, image);
    }
    return image;
}
项目:eZooKeeper    文件:EclipseCoreActivator.java   
@Override
protected void initializeImageRegistry(ImageRegistry imageRegistry) {
    super.initializeImageRegistry(imageRegistry);

    imageRegistry.put(IMAGE_KEY_ACTION_DELETE, getImageDescriptor(IMAGE_PATH_ACTION_DELETE));
    imageRegistry.put(IMAGE_KEY_ACTION_REFRESH, getImageDescriptor(IMAGE_PATH_ACTION_REFRESH));
    imageRegistry.put(IMAGE_KEY_ACTION_TABLE_EDIT, getImageDescriptor(IMAGE_PATH_ACTION_TABLE_EDIT));

    imageRegistry.put(IMAGE_KEY_OBJECT_EDIT, getImageDescriptor(IMAGE_PATH_OBJECT_EDIT));
    imageRegistry.put(IMAGE_KEY_OBJECT_HOME, getImageDescriptor(IMAGE_PATH_OBJECT_HOME));
    imageRegistry.put(IMAGE_KEY_OBJECT_INFORMATION, getImageDescriptor(IMAGE_PATH_OBJECT_INFORMATION));
    imageRegistry.put(IMAGE_KEY_OBJECT_MAIN_TAB, getImageDescriptor(IMAGE_PATH_OBJECT_MAIN_TAB));
    imageRegistry.put(IMAGE_KEY_OBJECT_PROPERTIES, getImageDescriptor(IMAGE_PATH_OBJECT_PROPERTIES));
    imageRegistry.put(IMAGE_KEY_OBJECT_SERVER, getImageDescriptor(IMAGE_PATH_OBJECT_SERVER));
    imageRegistry.put(IMAGE_KEY_OBJECT_SERVER_ADMIN, getImageDescriptor(IMAGE_PATH_OBJECT_SERVER_ADMIN));
    imageRegistry.put(IMAGE_KEY_OBJECT_SERVER_LARGE, getImageDescriptor(IMAGE_PATH_OBJECT_SERVER_LARGE));
    imageRegistry.put(IMAGE_KEY_OBJECT_SERVERS, getImageDescriptor(IMAGE_PATH_OBJECT_SERVERS));
    imageRegistry.put(IMAGE_KEY_OBJECT_SERVERS_LARGE, getImageDescriptor(IMAGE_PATH_OBJECT_SERVERS_LARGE));

    imageRegistry.put(IMAGE_KEY_WIZARD_BANNER_ADD_SERVER, getImageDescriptor(IMAGE_PATH_WIZARD_BANNER_ADD_SERVER));
}
项目:eclipse-bash-editor    文件:EclipseUtil.java   
/**
 * Get image by path from image registry. If not already registered a new
 * image will be created and registered. If not createable a fallback image
 * is used instead
 * 
 * @param path
 * @param pluginId
 *            - plugin id to identify which plugin image should be loaded
 * @return image
 */
public static Image getImage(String path, String pluginId) {
    ImageRegistry imageRegistry = getImageRegistry();
    if (imageRegistry == null) {
        return null;
    }
    Image image = imageRegistry.get(path);
    if (image == null) {
        ImageDescriptor imageDesc = createImageDescriptor(path, pluginId);
        image = imageDesc.createImage();
        if (image == null) {
            image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
        }
        imageRegistry.put(path, image);
    }
    return image;
}
项目:Tarski    文件:MarkerActivator.java   
@Override
protected ImageRegistry createImageRegistry() {
  String[] images = new String[] {Images.IMAGE_BLACK_ID, "/icons/Black.gif", Images.IMAGE_RED_ID,
      "/icons/Red.gif", Images.IMAGE_MENU_ID, "/icons/Menu.gif", Images.IMAGE_LINK_ID,
      "/icons/Link.gif", Images.IMAGE_DELETE_ID, "/icons/Delete.gif", Images.IMAGE_ANNOTATION_ID,
      "/icons/Annotation.gif", Images.IMAGE_SIG_ID, "/icons/sig.png", Images.IMAGE_RELATION_ID,
      "/icons/relation.png", Images.IMAGE_MODELWRITER_ID, "/icons/modelwriter.gif"};
  ImageRegistry imageRegistry = super.createImageRegistry();
  Iterator<String> i = Arrays.asList(images).iterator();
  while (i.hasNext()) {
    String id = i.next();
    String imagePath = i.next();
    imageRegistry.put(id, ImageDescriptor.createFromFile(getClass(), imagePath));
  }
  return imageRegistry;
}
项目:egradle    文件:EclipseUtil.java   
/**
 * Get image by path from image registry. If not already registered a new
 * image will be created and registered. If not createable a fallback image
 * is used instead
 * 
 * @param path
 * @param pluginId
 *            - plugin id to identify which plugin image should be loaded
 * @return image
 */
public static Image getImage(String path, String pluginId) {
    ImageRegistry imageRegistry = getImageRegistry();
    if (imageRegistry == null) {
        logWarning("No image registry found!");
        return null;
    }
    Image image = imageRegistry.get(path);
    if (image == null) {
        ImageDescriptor imageDesc = createImageDescriptor(path, pluginId);
        image = imageDesc.createImage();
        if (image == null) {
            image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
        }
        imageRegistry.put(path, image);
    }
    return image;
}
项目:subclipse    文件:SVNUIPlugin.java   
protected void initializeImageRegistry(ImageRegistry reg) {
    super.initializeImageRegistry(reg);
    reg.put(ISVNUIConstants.IMG_PROPERTIES, getImageDescriptor(ISVNUIConstants.IMG_PROPERTIES));
    reg.put(ISVNUIConstants.IMG_FILEADD_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FILEADD_PENDING));
    reg.put(ISVNUIConstants.IMG_SYNCPANE, getImageDescriptor(ISVNUIConstants.IMG_SYNCPANE));
    reg.put(ISVNUIConstants.IMG_FILEDELETE_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FILEDELETE_PENDING));
    reg.put(ISVNUIConstants.IMG_FILEMODIFIED_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FILEMODIFIED_PENDING));
    reg.put(ISVNUIConstants.IMG_FOLDERADD_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FOLDERADD_PENDING));
    reg.put(ISVNUIConstants.IMG_FOLDERDELETE_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FOLDERDELETE_PENDING));
    reg.put(ISVNUIConstants.IMG_FOLDERMODIFIED_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FOLDERMODIFIED_PENDING));
    reg.put(ISVNUIConstants.IMG_FOLDER, getImageDescriptor(ISVNUIConstants.IMG_FOLDER));
    reg.put(ISVNUIConstants.IMG_AFFECTED_PATHS_COMPRESSED_MODE, getImageDescriptor(ISVNUIConstants.IMG_AFFECTED_PATHS_COMPRESSED_MODE));
    reg.put(ISVNUIConstants.IMG_AFFECTED_PATHS_FLAT_MODE, getImageDescriptor(ISVNUIConstants.IMG_AFFECTED_PATHS_FLAT_MODE));
    reg.put(ISVNUIConstants.IMG_AFFECTED_PATHS_TREE_MODE, getImageDescriptor(ISVNUIConstants.IMG_AFFECTED_PATHS_TREE_MODE));
    reg.put(ISVNUIConstants.IMG_UPDATE_ALL, getImageDescriptor(ISVNUIConstants.IMG_UPDATE_ALL));
    reg.put(ISVNUIConstants.IMG_COMMIT_ALL, getImageDescriptor(ISVNUIConstants.IMG_COMMIT_ALL));
    reg.put(ISVNUIConstants.IMG_PROPERTY_CONFLICTED, getImageDescriptor(ISVNUIConstants.IMG_PROPERTY_CONFLICTED));
}
项目:bts    文件:XtextPluginImages.java   
private static final void initialize() {
    PLUGIN_REGISTRY = new ImageRegistry();
    manage(OBJ_DESC_SERVICE_LOADED, DESC_SERVICE_LOADED_OBJ);
    manage(OBJ_DESC_SERVICE_NOT_LOADED, DESC_SERVICE_NOT_LOADED_OBJ);
    manage(OBJ_DESC_LANGUAGE, DESC_LANGUAGE_OBJ);
    manage(OBJ_CORRECTION_CHANGE, DESC_CORRECTION_CHANGE);
    manage(OBJ_FIXABLE_ERROR, DESC_FIXABLE_ERROR);
    manage(OBJ_FIXABLE_WARNING, DESC_FIXABLE_WARNING);
    manage(OBJ_FIXABLE_INFO, DESC_FIXABLE_INFO);

    //cp
    manage(OBJ_DESC_ERROR, DESC_ERROR);
    manage(OBJ_DESC_EXCLAMATION, DESC_EXCLAMATION);
    manage(OBJ_DESC_INFORMATION, DESC_INFORMATION);

    initializeImageMaps();
}
项目:xtext-gef    文件:StatemachineNavigatorLabelProvider.java   
/**
 * @generated
 */
private Image getImage(String key, IElementType elementType) {
    ImageRegistry imageRegistry = StatemachineDiagramEditorPlugin
            .getInstance().getImageRegistry();
    Image image = imageRegistry.get(key);
    if (image == null && elementType != null
            && StatemachineElementTypes.isKnownElementType(elementType)) {
        image = StatemachineElementTypes.getImage(elementType);
        imageRegistry.put(key, image);
    }

    if (image == null) {
        image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
        imageRegistry.put(key, image);
    }
    return image;
}
项目:scouter    文件:XYGraphMediaFactory.java   
/**
 * Private constructor to avoid instantiation.
 */
private XYGraphMediaFactory() {
    _colorRegistry = new ColorRegistry();
    _imageRegistry = new ImageRegistry();
    _fontRegistry = new FontRegistry();

    _imageCache = new HashMap<ImageDescriptor, Image>();

    // dispose all images from the image cache, when the display is disposed
    Display.getDefault().addListener(SWT.Dispose, new Listener() {
        public void handleEvent(final Event event) {
            for (Image img : _imageCache.values()) {
                img.dispose();
            }
            disposeResources();
        }
    });

}
项目:limpet    文件:Activator.java   
public static Image getImageFromRegistry(final ImageDescriptor name)
{
  Image res = null;

  // do we already have an image
  if (getRegistry() == null)
  {
    plugin._imageRegistry = new ImageRegistry();
  }

  // ok - do we have it already?
  res = getRegistry().get(name.toString());

  if (res == null)
  {
    getRegistry().put(name.toString(), name);
    res = getRegistry().get(name.toString());
  }

  // and return it..
  return res;
}
项目:limpet    文件:Activator.java   
public static Image getImageFromRegistry(final ImageDescriptor name)
{
    Image res = null;

    // do we already have an image
    if (getRegistry() == null)
    {
        plugin._imageRegistry = new ImageRegistry();
    }

    // ok - do we have it already?
    res = getRegistry().get(name.toString());

    if (res == null)
    {
        getRegistry().put(name.toString(), name);
        res = getRegistry().get(name.toString());
    }

    // and return it..
    return res;
}
项目:APICloud-Studio    文件:ScriptingUIPlugin.java   
/**
 * Returns the image on the specified path.
 * 
 * @param path
 *            the path to the image
 * @return Image the image object
 */
public static Image getImage(String path)
{
    ImageRegistry registry = getDefault().getImageRegistry();

    if (registry.get(path) == null)
    {
        ImageDescriptor id = getImageDescriptor(path);

        if (id != null)
        {
            registry.put(path, id);
        }
    }

    return registry.get(path);
}
项目:APICloud-Studio    文件:SVGPlugin.java   
/**
 * getImage
 * 
 * @param path
 * @return
 */
public static Image getImage(String path)
{
    ImageRegistry registry = plugin.getImageRegistry();
    Image image = registry.get(path);

    if (image == null)
    {
        ImageDescriptor id = getImageDescriptor(path);

        if (id != null)
        {
            registry.put(path, id);
            image = registry.get(path);
        }
    }

    return image;
}
项目:APICloud-Studio    文件:XMLPlugin.java   
public static Image getImage(String path)
{
    ImageRegistry registry = plugin.getImageRegistry();
    Image image = registry.get(path);
    if (image == null)
    {
        ImageDescriptor id = getImageDescriptor(path);
        if (id == null)
        {
            return null;
        }
        registry.put(path, id);
        image = registry.get(path);
    }
    return image;
}
项目:APICloud-Studio    文件:SVNUIPlugin.java   
protected void initializeImageRegistry(ImageRegistry reg) {
    super.initializeImageRegistry(reg);
    reg.put(ISVNUIConstants.IMG_PROPERTIES, getImageDescriptor(ISVNUIConstants.IMG_PROPERTIES));
    reg.put(ISVNUIConstants.IMG_FILEADD_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FILEADD_PENDING));
    reg.put(ISVNUIConstants.IMG_SYNCPANE, getImageDescriptor(ISVNUIConstants.IMG_SYNCPANE));
    reg.put(ISVNUIConstants.IMG_FILEDELETE_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FILEDELETE_PENDING));
    reg.put(ISVNUIConstants.IMG_FILEMODIFIED_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FILEMODIFIED_PENDING));
    reg.put(ISVNUIConstants.IMG_FOLDERADD_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FOLDERADD_PENDING));
    reg.put(ISVNUIConstants.IMG_FOLDERDELETE_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FOLDERDELETE_PENDING));
    reg.put(ISVNUIConstants.IMG_FOLDERMODIFIED_PENDING, getImageDescriptor(ISVNUIConstants.IMG_FOLDERMODIFIED_PENDING));
    reg.put(ISVNUIConstants.IMG_FOLDER, getImageDescriptor(ISVNUIConstants.IMG_FOLDER));
    reg.put(ISVNUIConstants.IMG_AFFECTED_PATHS_COMPRESSED_MODE, getImageDescriptor(ISVNUIConstants.IMG_AFFECTED_PATHS_COMPRESSED_MODE));
    reg.put(ISVNUIConstants.IMG_AFFECTED_PATHS_FLAT_MODE, getImageDescriptor(ISVNUIConstants.IMG_AFFECTED_PATHS_FLAT_MODE));
    reg.put(ISVNUIConstants.IMG_AFFECTED_PATHS_TREE_MODE, getImageDescriptor(ISVNUIConstants.IMG_AFFECTED_PATHS_TREE_MODE));
    reg.put(ISVNUIConstants.IMG_UPDATE_ALL, getImageDescriptor(ISVNUIConstants.IMG_UPDATE_ALL));
    reg.put(ISVNUIConstants.IMG_COMMIT_ALL, getImageDescriptor(ISVNUIConstants.IMG_COMMIT_ALL));
    reg.put(ISVNUIConstants.IMG_PROPERTY_CONFLICTED, getImageDescriptor(ISVNUIConstants.IMG_PROPERTY_CONFLICTED));
}
项目:APICloud-Studio    文件:JSPlugin.java   
/**
 * getImage
 * 
 * @param path
 * @return
 */
public static Image getImage(String path)
{
    ImageRegistry registry = PLUGIN.getImageRegistry();
    Image image = registry.get(path);
    if (image == null)
    {
        ImageDescriptor id = getImageDescriptor(path);
        if (id == null)
        {
            return null;
        }
        registry.put(path, id);
        image = registry.get(path);
    }
    return image;
}
项目:APICloud-Studio    文件:ImageResource.java   
private static void initializeImageRegistry() {
    imageRegistry = new ImageRegistry();

    // load Web browser images
    registerImage(IMG_OBJ_BROWSER, URL_OBJ + "browser.png"); //$NON-NLS-1$

    registerImage(IMG_ELCL_NAV_BACKWARD, URL_ELCL + "nav_backward.gif"); //$NON-NLS-1$
    registerImage(IMG_ELCL_NAV_CONSOLE, URL_ELCL + "console.png"); //$NON-NLS-1$
    registerImage(IMG_ELCL_NAV_FORWARD, URL_ELCL + "nav_forward.gif"); //$NON-NLS-1$
    registerImage(IMG_ELCL_NAV_STOP, URL_ELCL + "nav_stop.gif"); //$NON-NLS-1$
    registerImage(IMG_ELCL_NAV_REFRESH, URL_ELCL + "nav_refresh.gif"); //$NON-NLS-1$
    registerImage(IMG_ELCL_NAV_GO, URL_ELCL + "nav_go.gif"); //$NON-NLS-1$
    registerImage(IMG_ELCL_NAV_HOME, URL_ELCL + "nav_home.gif"); //$NON-NLS-1$
    registerImage(IMG_ELCL_COMMAND, URL_ELCL + "command.png"); //$NON-NLS-1$

    registerImage(IMG_DLCL_NAV_BACKWARD, URL_DLCL + "nav_backward.gif"); //$NON-NLS-1$
    registerImage(IMG_DLCL_NAV_FORWARD, URL_DLCL + "nav_forward.gif"); //$NON-NLS-1$
    registerImage(IMG_DLCL_NAV_STOP, URL_DLCL + "nav_stop.gif"); //$NON-NLS-1$
    registerImage(IMG_DLCL_NAV_REFRESH, URL_DLCL + "nav_refresh.gif"); //$NON-NLS-1$
    registerImage(IMG_DLCL_NAV_GO, URL_DLCL + "nav_go.gif"); //$NON-NLS-1$
    registerImage(IMG_DLCL_NAV_HOME, URL_DLCL + "nav_home.gif"); //$NON-NLS-1$  
}
项目:APICloud-Studio    文件:CSSPlugin.java   
/**
 * getImage
 * 
 * @param path
 * @return
 */
public static Image getImage(String path)
{
    ImageRegistry registry = plugin.getImageRegistry();
    Image image = registry.get(path);

    if (image == null)
    {
        ImageDescriptor id = getImageDescriptor(path);

        if (id == null)
        {
            return null;
        }

        registry.put(path, id);
        image = registry.get(path);
    }

    return image;
}
项目:APICloud-Studio    文件:UIUtils.java   
public static Image getImage(AbstractUIPlugin plugin, String path)
{
    ImageRegistry registry = plugin.getImageRegistry();
    Image image = registry.get(path);
    if (image == null)
    {
        ImageDescriptor id = getImageDescriptor(plugin.getBundle().getSymbolicName(), path);
        if (id == null)
        {
            return null;
        }
        registry.put(path, id);
        image = registry.get(path);
    }
    return image;
}
项目:APICloud-Studio    文件:HTMLPlugin.java   
/**
 * getImage
 * 
 * @param path
 * @return
 */
public static Image getImage(String path)
{
    ImageRegistry registry = plugin.getImageRegistry();
    Image image = registry.get(path);

    if (image == null)
    {
        ImageDescriptor id = getImageDescriptor(path);

        if (id != null)
        {
            registry.put(path, id);
            image = registry.get(path);
        }
    }

    return image;
}
项目:mytourbook    文件:PoiView.java   
private void initImageRegistry() {

        final TourbookPlugin activator = TourbookPlugin.getDefault();
        final ImageRegistry imageRegistry = activator.getImageRegistry();

        if (imageRegistry.get(Messages.Image_POI_Anchor) == null) {

            imageRegistry.put(IMG_KEY_ANCHOR, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Anchor));
            imageRegistry.put(IMG_KEY_CAR, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Car));
            imageRegistry.put(IMG_KEY_CART, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Cart));
            imageRegistry.put(IMG_KEY_FLAG, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Flag));
            imageRegistry.put(IMG_KEY_HOUSE, TourbookPlugin.getImageDescriptor(Messages.Image_POI_House));
            imageRegistry.put(IMG_KEY_SOCCER, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Soccer));
            imageRegistry.put(IMG_KEY_STAR, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Star));
        }
    }
项目:mytourbook    文件:TourInfoIconToolTipProvider.java   
private void createInfoIcon() {

        if (_tourInfoImage != null) {
            return;
        }

        final ImageRegistry imageRegistry = TourbookPlugin.getDefault().getImageRegistry();

        imageRegistry.put(
                Messages.Image_ToolTip_TourInfo,
                TourbookPlugin.getImageDescriptor(Messages.Image_ToolTip_TourInfo));

        imageRegistry.put(
                Messages.Image_ToolTip_TourInfo_Hovered,
                TourbookPlugin.getImageDescriptor(Messages.Image_ToolTip_TourInfo_Hovered));

        _tourInfoImage = imageRegistry.get(Messages.Image_ToolTip_TourInfo);
        _tourInfoImageHovered = imageRegistry.get(Messages.Image_ToolTip_TourInfo_Hovered);

        _tourInfoImageSize = _tourInfoImage.getBounds();
    }
项目:mytourbook    文件:Activator.java   
@Override
public void start(final BundleContext context) throws Exception {

    // get bundle version
    final Bundle bundle = context.getBundle();
    if (bundle instanceof AbstractBundle) {
        final AbstractBundle abstractBundle = (AbstractBundle) bundle;
        fVersion = abstractBundle.getVersion();
    }

    final ImageRegistry imageRegistry = getImageRegistry();

    imageRegistry.put(IMG_KEY_ANCHOR, getImageDescriptor(Messages.Image_POI_Anchor));
    imageRegistry.put(IMG_KEY_CAR, getImageDescriptor(Messages.Image_POI_Car));
    imageRegistry.put(IMG_KEY_CART, getImageDescriptor(Messages.Image_POI_Cart));
    imageRegistry.put(IMG_KEY_FLAG, getImageDescriptor(Messages.Image_POI_Flag));
    imageRegistry.put(IMG_KEY_HOUSE, getImageDescriptor(Messages.Image_POI_House));
    imageRegistry.put(IMG_KEY_SOCCER, getImageDescriptor(Messages.Image_POI_Soccer));
    imageRegistry.put(IMG_KEY_STAR, getImageDescriptor(Messages.Image_POI_Star));

    super.start(context);
}
项目:tesb-studio-se    文件:CamelDesignerPlugin.java   
@Override
protected void initializeImageRegistry(ImageRegistry reg) {
    super.initializeImageRegistry(reg);
    reg.put(BEAN_WIZ_ICON, createImageDescriptor(BEAN_WIZ_ICON).createImage());

    reg.put(DEPEN_ICON, createImageDescriptor(DEPEN_ICON).createImage());
    reg.put(BUNDLE_CP_ICON, createImageDescriptor(BUNDLE_CP_ICON).createImage());
    reg.put(REQUIRE_BD_ICON, createImageDescriptor(REQUIRE_BD_ICON).createImage());
    reg.put(IMPORT_PKG_ICON, createImageDescriptor(IMPORT_PKG_ICON).createImage());
    reg.put(REFRESH_ICON, createImageDescriptor(REFRESH_ICON).createImage());
    reg.put(GRAY_REM_ICON, createImageDescriptor(GRAY_REM_ICON).createImage());
    reg.put(HIGHLIGHT_REM_ICON, createImageDescriptor(HIGHLIGHT_REM_ICON).createImage());
    reg.put(OPTIONAL_OVERLAY_ICON, createImageDescriptor(OPTIONAL_OVERLAY_ICON).createImage());
    reg.put(IMPORT_PACKAGE_OVERLAY_ICON, getOptionalOverlayIcon(getImage(IMPORT_PKG_ICON)));
    reg.put(REQUIRE_BUNDLE_OVERLAY_ICON, getOptionalOverlayIcon(getImage(REQUIRE_BD_ICON)));
}
项目:WP3    文件:MarkerActivator.java   
@Override
protected ImageRegistry createImageRegistry() {
  String[] images = new String[] {Images.IMAGE_BLACK_ID, "/icons/Black.gif", Images.IMAGE_RED_ID,
      "/icons/Red.gif", Images.IMAGE_MENU_ID, "/icons/Menu.gif", Images.IMAGE_LINK_ID,
      "/icons/Link.gif", Images.IMAGE_DELETE_ID, "/icons/Delete.gif", Images.IMAGE_ANNOTATION_ID,
      "/icons/Annotation.gif", Images.IMAGE_SIG_ID, "/icons/sig.png", Images.IMAGE_RELATION_ID,
      "/icons/relation.png", Images.IMAGE_MODELWRITER_ID, "/icons/modelwriter.gif"};
  ImageRegistry imageRegistry = super.createImageRegistry();
  Iterator<String> i = Arrays.asList(images).iterator();
  while (i.hasNext()) {
    String id = i.next();
    String imagePath = i.next();
    imageRegistry.put(id, ImageDescriptor.createFromFile(getClass(), imagePath));
  }
  return imageRegistry;
}
项目:JettyWTPPlugin    文件:JettyUIPlugin.java   
@Override
protected ImageRegistry createImageRegistry()
{
    ImageRegistry registry = new ImageRegistry();

    registerImage(registry,__IMG_WIZ_JETTY,__URL_WIZBAN + "jetty_wiz.png");

    registerImage(registry,__IMG_WEB_MODULE,__URL_OBJ + "web_module.gif");
    registerImage(registry,__IMG_PORT,__URL_OBJ + "port.gif");
    // registerImage(registry, IMG_WEB_MODULE, URL_OBJ + "web_module.gif");
    // registerImage(registry, IMG_MIME_MAPPING, URL_OBJ + "mime_mapping.gif");
    // registerImage(registry, IMG_MIME_EXTENSION, URL_OBJ + "mime_extension.gif");
    // registerImage(registry, IMG_PORT, URL_OBJ + "port.gif");
    registerImage(registry,__IMG_PROJECT_MISSING,__URL_OBJ + "project_missing.gif");

    return registry;
}
项目:JettyWTPPlugin    文件:JettyUIPlugin.java   
/**
 * Register an image with the registry.
 * 
 * @param key
 *            java.lang.String
 * @param partialURL
 *            java.lang.String
 */
private void registerImage(ImageRegistry registry, String key, String partialURL)
{
    if (__ICON_BASE_URL == null)
    {
        String pathSuffix = "icons/";
        __ICON_BASE_URL = getDefault().getBundle().getEntry(pathSuffix);
    }

    try
    {
        ImageDescriptor id = ImageDescriptor.createFromURL(new URL(__ICON_BASE_URL,partialURL));
        registry.put(key,id);
        _imageDescriptors.put(key,id);
    }
    catch (Exception e)
    {
        Trace.trace(Trace.WARNING,"Error registering image",e);
    }
}
项目:ROADDesigner    文件:SmcNavigatorLabelProvider.java   
/**
 * @generated
 */
private Image getImage(String key, IElementType elementType) {
    ImageRegistry imageRegistry = SmcDiagramEditorPlugin.getInstance()
            .getImageRegistry();
    Image image = imageRegistry.get(key);
    if (image == null && elementType != null
            && SmcElementTypes.isKnownElementType(elementType)) {
        image = SmcElementTypes.getImage(elementType);
        imageRegistry.put(key, image);
    }

    if (image == null) {
        image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
        imageRegistry.put(key, image);
    }
    return image;
}
项目:jive    文件:JiveSearchPageDescriptor.java   
public Image getSearchQueryIcon()
{
  final ImageRegistry registry = JiveUIPlugin.getDefault().getImageRegistry();
  final String key = getPluginId() + "/" + getLocalId();
  Image icon = registry.get(key);
  if (icon == null)
  {
    try
    {
      final ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
          getPluginId(), getIconPath());
      registry.put(key, descriptor);
      icon = registry.get(key);
    }
    // TODO Catch the right exception and log accordingly.
    // Also, handle the case when no icon is given better.
    catch (final Exception e)
    {
      // JiveUIPlugin.log(e);
      return null;
    }
  }
  return icon;
}
项目:birt    文件:StaticHTMLPrviewPlugin.java   
private void registerImage( ImageRegistry registry, String key,
        String fileName )
{
    try
    {
        IPath path = new Path( "icons/" + fileName ); //$NON-NLS-1$
        URL url = find( path );
        if ( url != null )
        {
            ImageDescriptor desc = ImageDescriptor.createFromURL( url );
            registry.put( key, desc );
        }
    }
    catch ( Exception e )
    {
    }
}
项目:birt    文件:UIHelper.java   
/**
 * This is a convenience method to get an imgIcon from a URL.
 * 
 * @param bundle
 *            The target bundle
 * @param sPluginRelativePath
 *            The URL for the imgIcon.
 * @param force
 *            If True, still returns a dummy image if the path cannot be
 *            loaded.
 * @return The imgIcon represented by the given URL.
 * 
 * @see #setImageCached(boolean )
 */
public static Image getImage( Bundle bundle, String sPluginRelativePath,
        boolean force )
{
    ImageRegistry registry = JFaceResources.getImageRegistry( );

    String imgKey = sPluginRelativePath;
    if ( bundle != null )
    {
        imgKey = bundle.getSymbolicName( ) + ":" + sPluginRelativePath; //$NON-NLS-1$
    }

    Image image = registry.get( imgKey );
    if ( image == null )
    {
        image = createImage( bundle, sPluginRelativePath, force );
        if ( image != null )
        {
            registry.put( imgKey, image );
        }
    }
    return image;
}
项目:HelloBrazil    文件:Wc2014NavigatorLabelProvider.java   
/**
 * @generated
 */
private Image getImage(String key, IElementType elementType) {
    ImageRegistry imageRegistry = Wc2014DiagramEditorPlugin.getInstance()
            .getImageRegistry();
    Image image = imageRegistry.get(key);
    if (image == null && elementType != null
            && Wc2014ElementTypes.isKnownElementType(elementType)) {
        image = Wc2014ElementTypes.getImage(elementType);
        imageRegistry.put(key, image);
    }

    if (image == null) {
        image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
        imageRegistry.put(key, image);
    }
    return image;
}
项目:simplified-bpmn-example    文件:SimpleBPMNNavigatorLabelProvider.java   
/**
 * @generated
 */
private Image getImage(String key, IElementType elementType) {
    ImageRegistry imageRegistry = SimpleBPMN.diagram.part.SimpleBPMNDiagramEditorPlugin
            .getInstance().getImageRegistry();
    Image image = imageRegistry.get(key);
    if (image == null
            && elementType != null
            && SimpleBPMN.diagram.providers.SimpleBPMNElementTypes
                    .isKnownElementType(elementType)) {
        image = SimpleBPMN.diagram.providers.SimpleBPMNElementTypes
                .getImage(elementType);
        imageRegistry.put(key, image);
    }

    if (image == null) {
        image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
        imageRegistry.put(key, image);
    }
    return image;
}
项目:Conferences    文件:DashBoard.java   
@Inject
public DashBoard(MApplication appli)
{
    // We will use the application context to store and inject values.
    IEclipseContext appliContext = appli.getContext();

    // We also need an ImageRegistry for the application
    appliContext.set(ImageRegistry.class, new ImageRegistry());

    // Step 5 : create and start Engine.
    EngineSimulator simu = ContextInjectionFactory.make(EngineSimulator.class, appliContext);
    appliContext.set(EngineSimulator.class, simu);

    // Step 8 : create the engine alarm watcher and keep a reference on it ! 
    EngineWatcher watcher = ContextInjectionFactory.make(EngineWatcher.class, appliContext);
    appliContext.set(EngineWatcher.class, watcher);
}
项目:Conferences    文件:BundleSpyPart.java   
private ImageRegistry initializeImageRegistry() {
    Bundle b = FrameworkUtil.getBundle(this.getClass());
    ImageRegistry imgReg = new ImageRegistry();
    imgReg.put(ICON_REFRESH,
            ImageDescriptor.createFromURL(b.getEntry(ICON_REFRESH)));
    imgReg.put(ICON_STATE_ACTIVE,
            ImageDescriptor.createFromURL(b.getEntry(ICON_STATE_ACTIVE)));
    imgReg.put(ICON_STATE_RESOLVED,
            ImageDescriptor.createFromURL(b.getEntry(ICON_STATE_RESOLVED)));
    imgReg.put(ICON_STATE_STARTING,
            ImageDescriptor.createFromURL(b.getEntry(ICON_STATE_STARTING)));
    imgReg.put(ICON_STATE_STOPPING,
            ImageDescriptor.createFromURL(b.getEntry(ICON_STATE_STOPPING)));
    imgReg.put(ICON_STATE_INSTALLED,
            ImageDescriptor.createFromURL(b.getEntry(ICON_STATE_INSTALLED)));
    imgReg.put(ICON_STATE_UNINSTALLED, ImageDescriptor.createFromURL(b
            .getEntry(ICON_STATE_UNINSTALLED)));
    imgReg.put(ICON_START,
            ImageDescriptor.createFromURL(b.getEntry(ICON_START)));
    imgReg.put(ICON_STOP,
            ImageDescriptor.createFromURL(b.getEntry(ICON_STOP)));

    ctx.set(ImageRegistry.class, imgReg);

    return imgReg;
}
项目:glassmaker    文件:GlassmakerUIPlugin.java   
protected void initializeImageRegistry(ImageRegistry reg) {
    super.initializeImageRegistry(reg);
    reg.put("org.glassmaker.ui.templates.text", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_text.gif")));
    reg.put("org.glassmaker.ui.templates.autoresize", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_autosize.gif")));
    reg.put("org.glassmaker.ui.templates.hybrid", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_hybrid.gif")));
    reg.put("org.glassmaker.ui.templates.hybridmosaic", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_hybridmosaic.gif")));
    reg.put("org.glassmaker.ui.templates.multipage", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_multipage.gif")));
    reg.put("org.glassmaker.ui.templates.simpleevent", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_simpleevent.gif")));
    reg.put("org.glassmaker.ui.templates.list", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_list.gif")));
    reg.put("org.glassmaker.ui.templates.knowledge", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_knowledge.gif")));
    reg.put("org.glassmaker.ui.templates.knowledgemosaic", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_knowledgemosaic.gif")));
    reg.put("org.glassmaker.ui.templates.stock", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_stock.gif")));
    reg.put("org.glassmaker.ui.templates.sports", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_sports.gif")));
    reg.put("org.glassmaker.ui.templates.flight", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_flight.gif")));
    reg.put("org.glassmaker.ui.templates.movie", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_movie.gif")));
    reg.put("org.glassmaker.ui.templates.transit", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_transit.gif")));
    reg.put("org.glassmaker.ui.templates.author", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_author.gif")));
    reg.put("org.glassmaker.ui.templates.simplemessage", ImageDescriptor.createFromURL(getBundle().getEntry("/icons/card_simplemessage.gif")));
}
项目:egitblit    文件:Activator.java   
@Override
protected void initializeImageRegistry(ImageRegistry registry){
    super.initializeImageRegistry(registry);
    try{
        Bundle bundle = Platform.getBundle(PLUGIN_ID);
        URL url;
        SharedImages[] items = SharedImages.values();
        for(SharedImages item : items){
            url = FileLocator.find(bundle, new Path(item.getImagePath()), null);
            ImageDescriptor desc = ImageDescriptor.createFromURL(url);
            registry.put(item.ID, desc);
        }
    }catch(Exception e){
        logError("Error initializing image registry of plugin", e);
    }
}
项目:robovm-eclipse    文件:RoboVMPlugin.java   
@Override
protected void initializeImageRegistry(ImageRegistry reg) {
    super.initializeImageRegistry(reg);

    Bundle bundle = plugin.getBundle();

    reg.put(IMAGE_NEW_CONSOLE_PROJECT_BANNER,
            getImageDescriptorFromPath(bundle, "icons/new_robovm_console_project_banner.png"));
    reg.put(IMAGE_NEW_IOS_PROJECT_BANNER,
            getImageDescriptorFromPath(bundle, "icons/new_robovm_ios_project_banner.png"));
    reg.put(IMAGE_NEW_IOS_STORYBOARD_BANNER,
            getImageDescriptorFromPath(bundle, "icons/new_robovm_ios_storyboard_banner.png"));
    reg.put(IMAGE_NEW_IOS_VIEW_CONTROLLER_BANNER,
            getImageDescriptorFromPath(bundle, "icons/new_robovm_ios_view_controller_banner.png"));
    reg.put(IMAGE_NEW_IOS_VIEW_BANNER,
            getImageDescriptorFromPath(bundle, "icons/new_robovm_ios_view_banner.png"));
}
项目:byteman-editor    文件:BytemanEditorPlugin.java   
@Override
protected void initializeImageRegistry(ImageRegistry registry) {
    super.initializeImageRegistry(registry);
    registry.put(KEY_IMG_RULE, createImageDescriptor(ICON_RULE));
    registry.put(KEY_IMG_SERVER, createImageDescriptor(ICON_SERVER));
    registry.put(KEY_IMG_SERVER_CONNECTED, new ServerConnectedImageDescriptor());
    registry.put(KEY_IMG_SERVER_DISCONNECTED, new ServerDisconnectedImageDescriptor());
    registry.put(KEY_IMG_REFRESH, createImageDescriptor(ICON_REFRESH));
    registry.put(KEY_IMG_LOCATION, createImageDescriptor(ICON_LOCATION));
    registry.put(KEY_IMG_OVR_STOP, createImageDescriptor(ICON_OVL_STOP));
    registry.put(KEY_IMG_BYTEMAN, createImageDescriptor(ICON_BYTEMAN));
    registry.put(KEY_IMG_BYTEMAN_ERROR, new BytemanErrorIconImageDescriptor());
    registry.put(KEY_IMG_BYTEMAN_WARNING, new BytemanWarningIconImageDescriptor());
    registry.put(KEY_IMG_RULE_ERROR, new RuleErrorImageDescriptor());
    registry.put(KEY_IMG_RULE_WARNING, new RuleWarningImageDescriptor());
    registry.put(KEY_IMG_CLASS_ERROR, new ClassErrorImageDescriptor());
    registry.put(KEY_IMG_CLASS_WARNING, new ClassWarningImageDescriptor());
    registry.put(KEY_IMG_INTERFACE_ERROR, new InterfaceErrorImageDescriptor());
    registry.put(KEY_IMG_INTERFACE_WARNING, new InterfaceWarningImageDescriptor());
    registry.put(KEY_IMG_METHOD_ERROR, new MethodErrorImageDescriptor());
    registry.put(KEY_IMG_METHOD_WARNING, new MethodWarningImageDescriptor());
    registry.put(KEY_IMG_LOCATION_ERROR, new LocationErrorImageDescriptor());
    registry.put(KEY_IMG_LOCATION_WARNING, new LocationWarningImageDescriptor());
}