有时候需要引用其它插件的图标,比如,有一个插件叫: net.foreworld.rss2,它的 icons 目录下有 file.gif 图,如果想引用此图标,在另一个插件的 plugin.xml 中,修改 xml 代码:
1.通过扩展点引用
<editor
...
icon="platform:/plugin/net.foreworld.rss2/icons/file.gif"
... />
...
icon="platform:/plugin/net.foreworld.rss2/icons/file.gif"
... />
//
2.通过代码引用:
public final static URL NODEICONURL = Plugin.getDefault().getBundle().getEntry("icons/node.jpg");
PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);