(Eclipse RCP) How can I add shortcut text after a menu entry in toolbar? [message #893178] |
Tue, 03 July 2012 02:17  |
Eclipse User |
|
|
|
I want to add shortcut text after the menu entry in toolbar.
For example, for "copy" menu entry in toolbar, default only a image in toolbar, and the tooltips will be "Copy (Ctrl+C)", what I need is adding "Ctrl + C" after the image of Copy menu entry, I did a lots of search, but can't find more useful material.
Also the action ( such as Copy ) has a shortcut, for example, "Ctrl + C", when our mouse hovers on the menu entry, will show "Copy (Ctrl+C)", but when I use Action.getText(), I only can get "Copy", not "Copy (Ctrl + C)"
Thanks for your help, this issue troubled me couple days.
Now some menu items from toolbar are added in method "fillCoolBar", and others are added from plugin.xml Extensions page.
|
|
|
Re: (Eclipse RCP) How can I add shortcut text after a menu entry in toolbar? [message #893859 is a reply to message #893178] |
Thu, 05 July 2012 13:35  |
Eclipse User |
|
|
|
In an RCP app there are extension points involved:
org.eclipse.ui.commands - define a command. Many standard ones are defined by org.eclipse.ui
org.eclipse.ui.bindings - define a short-cut for that command. CTRL+C is provided by org.eclipse.ui
org.eclipse.ui.menus - place commands in menus and toolbars. Menu items will show their shortcut if defined.
If you use Actions and ActionContributionItems, the Action must have its definitionId property set to the commandId in order to see the shortcut in the menu item.
PW
|
|
|
Powered by
FUDForum. Page generated in 0.08539 seconds