Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330114 - [Compatibility] Link the WW menu manager
Summary: [Compatibility] Link the WW menu manager
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.1 M4   Edit
Assignee: Remy Suen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-12 11:51 EST by Paul Webster CLA
Modified: 2010-11-17 09:40 EST (History)
0 users

See Also:


Attachments
Workbench window menu management patch v1 (8.54 KB, patch)
2010-11-15 11:04 EST, Remy Suen CLA
no flags Details | Diff
Workbench window menu management patch v2 (19.75 KB, patch)
2010-11-15 11:33 EST, Remy Suen CLA
no flags Details | Diff
Workbench window menu management patch v3 (24.13 KB, patch)
2010-11-16 09:22 EST, Remy Suen CLA
no flags Details | Diff
Workbench window menu management patch v4 (26.00 KB, patch)
2010-11-16 12:27 EST, Remy Suen CLA
no flags Details | Diff
Workbench window menu management patch v5 (26.00 KB, patch)
2010-11-16 13:54 EST, Remy Suen CLA
no flags Details | Diff
Workbench window menu management patch v6 (25.94 KB, patch)
2010-11-16 14:18 EST, Remy Suen CLA
no flags Details | Diff
Workbench window menu management patch v7 (26.01 KB, patch)
2010-11-17 09:40 EST, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2010-11-12 11:51:55 EST
Instead of copying the WorkbenchWindow menu manager code to the model, and then regenerating most of it, we can now link the window MMenu to the MenuManager filled in by the WorkbenchActionBuilder.

A compatibility level reconciler can create e4 equivalents for the contribution items we can translate (CommandContributionItems, ActionContributionItems that have a definition id, etc).

PW
Comment 1 Remy Suen CLA 2010-11-15 10:20:42 EST
The MMCs can be placed in the right place in the model but the widgets generated by the menu manager do not because they simply get appended at the end instead of having their desired placement positions honoured.
Comment 2 Remy Suen CLA 2010-11-15 11:04:00 EST
Created attachment 183128 [details]
Workbench window menu management patch v1
Comment 3 Remy Suen CLA 2010-11-15 11:33:15 EST
Created attachment 183138 [details]
Workbench window menu management patch v2
Comment 4 Paul Webster CLA 2010-11-15 16:52:28 EST
Had a quick look at the patch.

Could we look at an in place reconciliation step in WorkbenchWindow?  So have org.eclipse.ui.internal.WorkbenchWindow.fill(MMenu, IMenuManager) work similiarly to org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.reconcileManagerToModel(MenuManager, MMenu) with the added abilities to turn CCI, ACIs with definitionIDs, and other MenuManagers into proper model items.

Then you don't have to do a removeAll() after that, the rendering will work with Model and Opaque model that we've just created.

PW
Comment 5 Remy Suen CLA 2010-11-16 09:22:50 EST
Created attachment 183221 [details]
Workbench window menu management patch v3

The SwitchToWindowMenu isn't showing up properly.
Comment 6 Remy Suen CLA 2010-11-16 09:40:19 EST
(In reply to comment #5)
> The SwitchToWindowMenu isn't showing up properly.

First it gets populated. Then the final 'parentManager.update(false)' call in MenuManager's processContents(*) ends up disposing them.
Comment 7 Remy Suen CLA 2010-11-16 12:27:47 EST
Created attachment 183243 [details]
Workbench window menu management patch v4

Things should now look the same as patch v2. This patch includes the removal of the optimization code in SwitchToWindowMenu to workaround the double update problem coming from MenuManager.
Comment 8 Remy Suen CLA 2010-11-16 13:54:18 EST
Created attachment 183256 [details]
Workbench window menu management patch v5
Comment 9 Remy Suen CLA 2010-11-16 14:18:37 EST
Created attachment 183259 [details]
Workbench window menu management patch v6

Forgot to uncomment some stuff I was testing.
Comment 10 Remy Suen CLA 2010-11-17 09:40:19 EST
Created attachment 183298 [details]
Workbench window menu management patch v7
Comment 11 Remy Suen CLA 2010-11-17 09:40:49 EST
(In reply to comment #10)
> Created an attachment (id=183298) [details]
> Workbench window menu management patch v7

Patch released to CVS HEAD.