File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Accelerator keys

Benjamin Malebana

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:

name="Undo all Modifications"
description="Undo all Modifications"
string= "CTRL+2"

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

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

"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

Joined: Jul 08, 2003
Posts: 24199


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:
subject: Accelerator keys
It's not a secret anymore!