xml - Eclipse RCP: How can I reference an icon from a plugin? -
i have eclipse rcp application plugins , commands. 1 of commands want utilize icon 1 of included plugins.
the plugin called com.example.plugin.workspace
, path icon icons/workspace.png
.
i reference in application's plugin.xml, want add together command toolbar:
<menucontribution allpopups="false" locationuri="toolbar:org.eclipse.ui.main.toolbar?after=additions"> <toolbar id="com.example.application.displays.toolbar"> <command commandid="com.example.application.system.command.openworkspace" icon="path icon in plugin" label="open workspace" style="push"> </command> </toolbar> </menucontribution>
can reference icon of plugin there, , if yes, how?
an icon included plugin can referenced in xml prefix:
platform:/plugin/bundle-symbolicname/path/filename.extension
see http://www.vogella.com/tutorials/eclipsercp/article.html#runtime_uri
so, in illustration of question, be:
platform:/plugin/com.example.plugin.workspace/icons/workspace.png
for toolbar contribution:
<menucontribution allpopups="false" locationuri="toolbar:org.eclipse.ui.main.toolbar?after=additions"> <toolbar id="com.example.application.displays.toolbar"> <command commandid="com.example.application.system.command.openworkspace" icon="platform:/plugin/com.example.plugin.workspace/icons/workspace.png" label="open workspace" style="push"> </command> </toolbar> </menucontribution>
xml eclipse eclipse-plugin eclipse-rcp
No comments:
Post a Comment