Community
Participate
Working Groups
Some accelerator doesn't work if an item is added under Help menu. How to reproduce: Prepare: I just use "Plug-in project wizard" and select "Plug-in with a multi-page editor". Then add the following code to modify MultiPageEditorContributor#setActivePage(). --------------------------------------------- IMenuManager fm = actionBars.getMenuManager().findMenuUsingPath (IWorkbenchActionConstants.M_HELP); if (null != fm) { fm.removeAll(); fm.setVisible(true); fm.add(new Separator()); } actionBars.updateActionBars(); --------------------------------------------- Run: 1. Open the editor 2. switch to "Properties" page and go back to default page 3. try "Ctrl+A", "Ctrl+Z", "Ctrl+F"
Created attachment 4364 [details] MultiPageEditorContributor.java
Comment on attachment 4364 [details] MultiPageEditorContributor.java Override the file onto output of "multi-page editor" of "plug-in project wizard"
I checked this problem on R2.1RC1 and R2.1RC3b
The key bindings mechanism internally uses hidden menu items in the last menu (i.e. the Help menu) to obtain accelerator keys. This is due to an SWT limitation that prevents us from obtaining them in any other way.
Yes, I know the AcceleratorMenu is created as child of Help menu. The problem is the menu is disposed when IActionBars#updateActionBars() is called if Help menu is dirty (Actually, MenuManager#update() disposes it). The AcceleratorMenu is recreated in WWinKeyBindingService#updateAccelerators(). But the recreation happens only when the editor is deactivated. So, after the AcceleratorMenu is disposed, switching to another view and switching back to the editor activates accelerator again. I think AcceleratorMenu recreation should be done while page changed. In IActionBars#updateActionBars() or somewhere. This problem is critical for our application because we have a lot of accelerators and we add a menu item under Help menu.
Should investigate whether the AcceleratorMenu can be contributed by a ContributionItem, so that even if the menus are updated, it does not get omitted.
Is there any workaroud for this problem ? If nohing, I expect the problem will be fixed in 2.1.1.
fixed 2.1.1. changed MenuManager to not dispose any MenuItem containing a specific data object (via .setData(..)) shared by the AcceleratorMenu. this way no new API was required to bridge jface and workbench for this problem.
This problem still exists on GTK in build 20030530.
tried with M20030602 following exact steps. was not able to reproduce this problem. i am on mac osx. i've asked tod to retry on GTK, though platform should not be an issue here. reclosing as fixed, though we may see this again.. :)
verified on mac, tod verified on windows and gtk.