Key Bindings for Actions does [message #600961] |
Wed, 26 August 2009 09:48 |
|
Hello!
I tried to associate a key binding to an action in my RCP application. I
followed the steps on the following two sites:
But what should I say, it simply doesn't work. I know that this
statement isn't very helpful, but i have absolutely no idea what the
problem might be.
So i tried to add such an key bound action to a brand new Sample RCP
(The one with a single View). I used the standard "about" action for
convenience, added it to the main menu and created a key binding. With
the same result: The Action is shown in the Menu and can be clicked, but
when i press the associated keys, nothing happens.
The code i changed from the standard template can be found below... Does
anybody have an idea?
Thanks, Ralf
PS: I use Eclipse 3.5 on Ubuntu Linux 9.04
#### ApplicationActionBarAdvisor ####
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
private IWorkbenchAction exitAction;
private IWorkbenchAction aboutAction;
public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
super(configurer);
}
protected void makeActions(final IWorkbenchWindow window) {
aboutAction = ActionFactory.ABOUT.create(window);
aboutAction.setActionDefinitionId("aboutCommand");
register(aboutAction);
exitAction = ActionFactory.QUIT.create(window);
register(exitAction);
}
protected void fillMenuBar(IMenuManager menuBar) {
MenuManager fileMenu = new MenuManager("&File",
IWorkbenchActionConstants.M_FILE);
menuBar.add(fileMenu);
fileMenu.add(aboutAction);
fileMenu.add(exitAction);
}
}
### plugin.xml ###
<extension
point="org.eclipse.ui.commands">
<command
id="aboutCommand"
name="About">
</command>
</extension>
<extension
id="custom-bindings"
point="org.eclipse.ui.bindings">
<key
commandId="aboutCommand"
contextId="org.eclipse.ui.contexts.dialogAndWindow"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="M2+M3+J">
</key>
</extension>
|
|
|
Powered by
FUDForum. Page generated in 0.03100 seconds