Skip to main content



      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 02:17 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Eclipse RCP Product export issue
Next Topic:Eclipse 3.8 and Apache Batik
Goto Forum:
  


Current Time: Wed Mar 19 06:29:46 EDT 2025

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

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

Back to the top