Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Menu accelerators not always active
Menu accelerators not always active [message #761991] Wed, 07 December 2011 11:54 Go to next message
Paul Ramsden is currently offline Paul Ramsden
Messages: 79
Registered: February 2011
Location: BW, Germany
Member
I am trying to debug an app which contains a custom editor. There is a menu which is added when the editor is loaded. The menu contains various actions and keyboard accelerators are attached.

When an action is selected from the menu it always executes. If I then use a keyboard accelerator this also works. However, if the editor loses focus and is reselected, the accelerators no longer function. When the menu is used to select an action the accelerators are functional again.

Any ideas what the cause might be and what I can do to overcome the problem?

Thanks

Paul

[Updated on: Wed, 07 December 2011 11:54]

Report message to a moderator

Re: Menu accelerators not always active [message #762161 is a reply to message #761991] Wed, 07 December 2011 16:25 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

In Eclipse RCP or IDE apps, the framework uses commands and keybindings to get accelerators to work. If you are simply adding them to the SWT MenuItem (via IAction setAccelerator(*) as well) then those accelerators are only valid while the MenuItem is created. If you close the editor, that menu is disposed and those accelerators will no longer be available. If you open the editor but not the menu, those MenuItems have not been created and it won't work either.

Use commands if you want persistent key shortcuts that aren't tied to your editor.

PW


Previous Topic:Missing Constraint:... org.apache.lucene; bundle-version=[1.9.0;2.0.0)
Next Topic:WindowBuilder databinding with EMFEditObservables
Goto Forum:
  


Current Time: Mon Sep 22 06:24:07 GMT 2014

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

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