File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes RCP shortcut keys! Pls HELP! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "RCP shortcut keys! Pls HELP!" Watch "RCP shortcut keys! Pls HELP!" New topic
Author

RCP shortcut keys! Pls HELP!

Benjamin Malebana
Greenhorn

Joined: Jul 15, 2005
Posts: 7
Hi everyone I have an RCP(Rich Client Platform) Application with different toolBar actions, what I want is to have a shortcut key for each action the toolbar. My actions have been created programatically in .java file not in an xml file.

I have a code but it doesn't respont when a shortcut key assigned to it is pressed.

>>>>>>>>My xml code>>>>>>>>>>>>>>>>

<extension
point="org.eclipse.ui.commands">
<category
id="UserManagementWorkStation.category"
name="User Management Workstation"/>
<command
name="Undo all Modifications"
description="Undo all Modifications"
categoryId="UserManagementWorkStation.category"
id="UserManagementWorkStation.openMessage">
</command>
<keyBinding
commandId="UserManagementWorkStation.openMessage"
description="Add new User"
keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration"
keySequence= "CTRL+N">
</keyBinding>
</extension>
<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>My Java code>>>>>>>>>>>>>>>>
getViewSite().getKeyBindingService().registerAction(addUserAction);
getViewSite().getActionBars().setGlobalActionHandler(addUserAction.getId(), addUserAction);

The above java code is supposed to register the shortcut key is I am not mistaken.

Please help me guys I can't move from this point. Some people did give advice but its more Swing orientated I want the RCP orientated solution.
[ July 21, 2005: Message edited by: Benjamin Malebana ]
Benjamin Malebana
Greenhorn

Joined: Jul 15, 2005
Posts: 7
I got the shortcut keys working guys thank you. The problem I have just realised was that the CTRL+"ANY KEY" isn't working, then I resorted to Alt+"any key". Maybe its a problem of Eclipse 3.0 I am using, I am not sure.
 
wood burning stoves
 
subject: RCP shortcut keys! Pls HELP!