aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Accelerator keys Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Accelerator keys" Watch "Accelerator keys" New topic
Author

Accelerator keys

Benjamin Malebana
Greenhorn

Joined: Jul 15, 2005
Posts: 7
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

Joined: Jul 22, 2000
Posts: 9046
    
  10
Please do not cross-post. Thanks.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

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.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accelerator keys