Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » (Eclipse RCP) How can I add shortcut text after a menu entry in toolbar?
icon5.gif  (Eclipse RCP) How can I add shortcut text after a menu entry in toolbar? [message #893178] Tue, 03 July 2012 06:17 Go to next message
Diao Feng is currently offline Diao FengFriend
Messages: 1
Registered: July 2012
Junior Member
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 17:35 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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.


Previous Topic:Eclipse RCP Product export issue
Next Topic:Eclipse 3.8 and Apache Batik
Goto Forum:

Current Time: Sun Apr 21 15:17:23 GMT 2024

Powered by FUDForum. Page generated in 0.03120 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top