Adel Boutros
Adel Boutros

Reputation: 10285

In Eclipse RCP, is it possible to show both icon and label for a toolbar item?

If the icon and the label are both defined in the plugin.xml then only the icon will be displayed but if the icon attribute is removed, then only the label is displayed.

Is it possible to have both visible?

Icon:

<toolbar id="my.toolbar">
  <command commandId="my.Command"
    icon="import.gif" id="commandID"
    label="Import Config" style="push">
  </command>
</toolbar>

Label:

<toolbar id="my.toolbar">
  <command commandId="my.Command"
    label="Import Config" style="push">
  </command>
</toolbar>

Upvotes: 2

Views: 1214

Answers (1)

Alex K.
Alex K.

Reputation: 3304

Please use mode option with FORCE_TEXT value:

mode - For actions appearing in a toolbar, FORCE_TEXT will show text even if there is an icon. See ActionContribuitonItem.

http://help.eclipse.org/helios/nftopic/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_viewActions.html

Upvotes: 5

Related Questions