Community
Participate
Working Groups
I20100701-1105. 1. start new workspace 2. create a Java project 3. create a file 4. open 'Edit' main menu ==> most contributed items are missing (e.g. content assist, find actions).
This seems to be what's happening on 3.x. Thread [main] (Suspended) MenuManager.update(boolean, boolean) line: 819 MenuManager.update(boolean) line: 678 EditorMenuManager(SubMenuManager).update(boolean) line: 364 TextEditorActionContributor.doSetActiveEditor(IEditorPart) line: 118 TextEditorActionContributor.setActiveEditor(IEditorPart) line: 144 EditorActionBars.partChanged(IWorkbenchPart) line: 343 WorkbenchPage$3.run() line: 635 SafeRunner.run(ISafeRunnable) line: 42 Platform.run(ISafeRunnable) line: 888 WorkbenchPage.activatePart(IWorkbenchPart) line: 624 WorkbenchPage.setActivePart(IWorkbenchPart, boolean) line: 3533 WorkbenchPage.internalActivate(IWorkbenchPart, boolean) line: 617 WorkbenchPage.activate(IWorkbenchPart) line: 589 WorkbenchPage.busyOpenEditorBatched(IEditorInput, String, boolean, int, IMemento) line: 2875 WorkbenchPage.busyOpenEditor(IEditorInput, String, boolean, int, IMemento) line: 2768 WorkbenchPage.access$11(WorkbenchPage, IEditorInput, String, boolean, int, IMemento) line: 2760 WorkbenchPage$10.run() line: 2711 BusyIndicator.showWhile(Display, Runnable) line: 70 WorkbenchPage.openEditor(IEditorInput, String, boolean, int, IMemento) line: 2707 WorkbenchPage.openEditor(IEditorInput, String, boolean, int) line: 2691 WorkbenchPage.openEditor(IEditorInput, String, boolean) line: 2682
The editor adds items _directly_ to the 'Edit' menu's menu manager. However, in 4.0 we have already parsed that manager and transformed its items into model elements so further changes to that manager do not get reflected.
Created attachment 174492 [details] EditorMenuManager hijacking patch v1 We intercept contributions to the EditorMenuManager and turn them into MMCs. This is _incomplete_. You _will_ get duplicates if you have a Java editor and a text editor up. There are also still some missing entries.
Created attachment 174535 [details] EditorMenuManager hijacking patch v2 More items are showing. The only one that isn't right now is the 'Set Encoding...' action as it has no action definition id and is a retarget action in the "truest" sense of the word as it directly sets its internal action. There are also ordering and separator problems but at least things are showing up now.
Created attachment 174775 [details] EditorMenuManager hijacking patch v3 'Set Encoding...' is still missing and the items are still a little out of place but the 'Content Assist' submenu seems to be showing up consistently now.
>The only one that isn't right now is the 'Set Encoding...' action I don't know how you tested this but using SDK 4.0 - I20100720-2028 with these steps: 1. start new workspace 2. Package Explorer > context menu > New > Untitled Text File 3. main menu > Edit ==> I see 10 entries while on on 3.6 there are 18 ==> 8 missing 4. paste this into Package Explorer: class A {} 5. main menu > Edit ==> I see 11 entries while on on 3.6 there are 22 ==> 11 missing
(In reply to comment #6) > >The only one that isn't right now is the 'Set Encoding...' action > I don't know how you tested this but using SDK 4.0 - I20100720-2028 Dani, neither Paul and I have released the patch to HEAD. It sounds to me you are just testing your outer and not the inner (with the patch applied).
Ah, OK! Sometimes Paul commits the patches but doesn't close the bug. I always only test directly on the build. So please ignore my previous comment.
(In reply to comment #8) > Ah, OK! Sometimes Paul commits the patches but doesn't close the bug. Sorry for adding to the confusion :-) PW
Created attachment 174934 [details] EMM hijacking patch v4 The plan is to post-process the MenuManagers added. I'm not sure where the first Expand Selection To is coming from. PW
>I'm not sure where the first Expand Selection To is coming from. FYI: The menu is added by BasicJavaEditorActionContributor.contributeToMenu(IMenuManager)
Created attachment 175004 [details] EMM hijacking patch v05 Work in progress. Provides editor menus and submenus. 1) 3 items appear out of order 2) there are 3 separators in a row in a text editor PW
The check state of 'Smart Insert Mode' doesn't seem to stick but I believe that's a duplicate of some other generic bug.
CCE thrown when opening the 'Edit' menu in the "sub text editor" of a build.properties form editor. java.lang.ClassCastException: org.eclipse.jface.action.SubContributionItem incompatible with org.eclipse.jface.action.ContributionItem at org.eclipse.e4.ui.workbench.renderers.swt.RenderedMenuItemRenderer.fill(RenderedMenuItemRenderer.java:79) at org.eclipse.e4.ui.workbench.renderers.swt.RenderedMenuItemRenderer.createWidget(RenderedMenuItemRenderer.java:73) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:612) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:403) at org.eclipse.e4.ui.workbench.swt.modeling.MenuServiceFilter.render(MenuServiceFilter.java:235) at org.eclipse.e4.ui.workbench.swt.modeling.MenuServiceFilter.showMenu(MenuServiceFilter.java:155) at org.eclipse.e4.ui.workbench.swt.modeling.MenuServiceFilter.handleMenu(MenuServiceFilter.java:117) at org.eclipse.e4.ui.workbench.swt.modeling.MenuServiceFilter.handleEvent(MenuServiceFilter.java:103) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
Created attachment 175061 [details] EditorMenuManager hijacking patch v6 Added instanceof checks to prevent CCEs.
Created attachment 175064 [details] EditorMenuManager hijacking patch v7 We were getting doubles with multiple workbench windows. Now we expand our expression to include checking both the editor's id and the active workbench window.
(In reply to comment #16) > Created an attachment (id=175064) [details] > EditorMenuManager hijacking patch v7 We need to fix org.eclipse.ui.internal.EditorReference.disposeEditorActionBars(EditorActionBars) so that it only disposes the EAB for that window We need to scope org.eclipse.ui.internal.EditorMenuManager.disposeManager() to the current EditorActionBars/IWW We need to make sure our EABs are disposed on shutdown and on window close. PW
Created attachment 175068 [details] EditorMenuManager hijacking patch v8 Added more code to consider scenarios during shutdown and multiple workbench windows.
Scary patch, but much better than what we've had before. I hope we won't have too much fallout :-) +1
(In reply to comment #18) > Created an attachment (id=175068) [details] > EditorMenuManager hijacking patch v8 +1 We'll track the behaviour of the build. Remy, feel free to release. PW
(In reply to comment #18) > Created an attachment (id=175068) [details] > EditorMenuManager hijacking patch v8 Patch released to HEAD. Opened two other known bugs at the moment. -------- Bug 320739 [Compatibility] 'Content Assist' submenu of the 'Edit' menu appears in the wrong place Bug 320740 [Compatibility] SubContributionItems and SubMenuManagers do not get contributed to the editor action bars
Verified in SDK 4.0 - I20100722-2038.