Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330114

Summary: [Compatibility] Link the WW menu manager
Product: [Eclipse Project] e4 Reporter: Paul Webster <pwebster>
Component: UIAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: 4.1 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Workbench window menu management patch v1
none
Workbench window menu management patch v2
none
Workbench window menu management patch v3
none
Workbench window menu management patch v4
none
Workbench window menu management patch v5
none
Workbench window menu management patch v6
none
Workbench window menu management patch v7 none

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.