Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » JFace dynamic menu accelerators
JFace dynamic menu accelerators [message #467027] Fri, 27 April 2007 09:00 Go to next message
Michael Baranov is currently offline Michael BaranovFriend
Messages: 6
Registered: July 2009
Junior Member
Greetings!
...Please redirect me if I'm in the wrong group with this...

I'm trying to create a dynamic menu with JFace (no RCP). I'm using
MenuManager, the usual code for a dynamic menu. The problem is that
accelerators do not work unless the menu is displayed at least once.

Obviously, when the menu is displayed, it is recreated. After recreation
accelerators work. That's logical. But how to overcome this problem? I
would like the menu to be recreated on accelerator-key-press too.

Thank you!
Re: JFace dynamic menu accelerators [message #467038 is a reply to message #467027] Fri, 27 April 2007 11:53 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

In SWT (and JFace) if you want to use accelerators (CTRL+SHIFT+T) you
normally have to instantiate a menu from the MenuManager. Once the menu
items have the accelerator text, then accelerators work ... but they
won't work until you create the menu. I think you can use MenuManager
API to force the create of the menu without actually showing it.

The other alternative is to put a KeyDown/Traverse filter on the Display
so you can react to *all* incoming key events ... but then you have to
manage that yourself somehow (in eclipse we use WorkbenchKeyboard).

Later,
PW


Previous Topic:Re: EclipseStarter Problem
Next Topic:SelectionProvider?
Goto Forum:
  


Current Time: Tue Apr 16 08:20:34 GMT 2024

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

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

Back to the top