Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » JFace dynamic menu accelerators
JFace dynamic menu accelerators [message #467027] Fri, 27 April 2007 05:00 Go to next message
Eclipse UserFriend
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 07:53 Go to previous message
Eclipse UserFriend
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: Thu May 22 19:39:15 EDT 2025

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

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

Back to the top