Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accelerator keys

 
Benjamin Malebana
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I have an RCP application with different actions on it, the problem I am having is setting up shortcut keys for those actions. My application is running on Eclipse 3.0.

My xml file look like this:

<extension
point="org.eclipse.ui.commands">
<command
name="Undo all Modifications"
description="Undo all Modifications"
categoryId="UserManagementWorkStation.commands"
id="com.vastech.ngmc.rcp.umws.views.ICommandIds.CMD_OPEN_MESSAGE">
</command>
<keyBinding
string= "CTRL+2"
commandId="com.vastech.ngmc.rcp.umws.views.ICommandIds.CMD_OPEN_MESSAGE"
configuration="org.eclipse.ui.defaultAcceleratorConfiguration">
</keyBinding>
</extension>

I understand that somehow we need to register the action in the .java file and I am not sure how to do that, I did have something like this setActionDefinitionId(ICommandIds.CMD_OPEN_MESSAGE);
setId(ICommandIds.CMD_OPEN_MESSAGE); but the short pressing ctrl+2 nothing happens. I will be happy if someone who understand dealing with shortcut keys can take me through them or refer me to articles. Thanks in advance.
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not cross-post. Thanks.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

We've got a forum devoted to SWT/JFace issues (and Swing and AWT, too) which is really where this question belongs; I'll move it there for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic