开发者

Menu contribution with icon and text

开发者 https://www.devze.com 2023-03-22 11:42 出处:网络
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, ho开发者_StackOverflow中文版wever, to display

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, ho开发者_StackOverflow中文版wever, 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 contribution with icon and text


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号