Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Key Bindings for Actions does
Key Bindings for Actions does [message #600961] Wed, 26 August 2009 09:48
Ralf Grossklaus is currently offline Ralf GrossklausFriend
Messages: 20
Registered: July 2009
Location: Stuttgart, Germany
Junior Member
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>
Previous Topic:try without catch. A Bug?
Next Topic:Headless Pde build : build All
Goto Forum:
  


Current Time: Wed Apr 24 17:50:04 GMT 2024

Powered by FUDForum. Page generated in 0.03100 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top