paweloque
paweloque

Reputation: 18904

Menu contribution with icon and text

It is possible to create a menu item in eclipse with an icon and a text? Normally all menu items on the main menu are displayed with an icon only. I need, however, to display a short text next to the icon.

E.g. in the attached screenshot the "R2" short text next to the "run" icon (I don't want to enhance the "run" menu, this is just an example).

Menu with icon and text

Upvotes: 0

Views: 595

Answers (1)

Paul Webster
Paul Webster

Reputation: 10654

For a command contributed through org.eclipse.ui.menus you can add the mode attribute. See the Extension Point Description (you can get to that from the PDE Editor>Extensions tab).

<extension point="org.eclipse.ui.menus">
   <menuContribution locationURI="toolbar:org.eclipse.ui.workbench.file">
     <command commandId="org.eclipse.ui.edit.copy"
              mode="FORCE_TEXT"/>
   </menuContribution>
</extension>

Upvotes: 4

Related Questions