eclipse - How can I reference an icon from a plugin? -


I have an Eclipse RCP application with some plugins and some commands for one command I get one of the plugins included I want to use the icon.

The plugin is called com.example.plugin.workspace and the path of the icon is icons / workspace.png .

I would like to refer to it in my application's plugin.xml, where I want to add command to a toolbar:

  & Lt; Menu Edit All Popup = "False" Location URI = "Toolbars: org.eclipse.ui.main.toolbar? After = Extra" & gt; & Lt; Toolbar ID = "com.example.application.displays.toolbar" & gt; & Lt; Command command id = "com.example.application.system.command.OpenWorkspace" icon = "path to the icon in the plugin" label = "open workspace" style = "push"> gt; & Lt; / Order & gt; & Lt; / Toolbar & gt; & Lt; / MenuContribution & gt;  

Can I refer to the plugin's icon there and if yes, then how?

An icon with an included plugin can be referred to XML with Exaxes:

  Platform: /plugin/Bundle-SymbolicName/path/filename.extension  

View

Therefore, in the example of the question, it would be:

  For Forum: / plugin / com.example.plugin.workspace Toolbar Contributors:  
  & lt; Menu All Distribution Popup = "False" Location: RI = "Tool Bar: org.eclipse.ui .main.toolbar = Extra" & gt? & Lt; Toolbar ID = "com.example.application.displays.toolbar" & gt; & Lt; Command command id = "com.example.application.system.command.OpenWorkspace" icon = "platform: / plugin / com.plug.plugin workspace / concert / workspace page" label = "open workspace" style = "push" & gt; ; & Lt; / Order & gt; & Lt; / Toolbar & gt; & Lt; / MenuContribution & gt;  

Comments