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

Bug 336061

Summary: Extra (empty) menu in the workbench window's menu bar
Product: [Eclipse Project] e4 Reporter: Bryan Hunt <bhunt>
Component: UIAssignee: Paul Webster <pwebster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, bsd, dj.houghton, emoffatt, pwebster, remy.suen
Version: 1.0   
Target Milestone: 4.1 RC3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
screenshot
none
Patch to honour group markers v01
none
Patch to honour group markers v02 none

Description Bryan Hunt CLA 2011-02-02 08:13:51 EST
Created attachment 188132 [details]
screenshot

SDK 4.1 M5 shows an extra (empty) menu on OS X between Run and Window.  See the attached screenshot.
Comment 1 Brian de Alwis CLA 2011-02-17 10:33:54 EST
I suspect it's because the menu bar has two menu separators in a row.

Top-level MenuManager's contributions:

MenuManager: id=file text=&File
MenuManager: id=edit text=&Edit
MenuManager: id=org.eclipse.jdt.ui.source.menu text=&Source
MenuManager: id=org.eclipse.jdt.ui.refactoring.menu text=Refac&tor
MenuManager: id=navigate text=&Navigate
MenuManager: id=org.eclipse.search.menu text=Se&arch
MenuManager: id=project text=&Project
org.eclipse.jface.action.GroupMarker(id=additions)
MenuManager: id=org.eclipse.ui.run text=&Run
org.eclipse.jface.action.Separator(id=navigate)
org.eclipse.jface.action.Separator(id=edit)
MenuManager: id=window text=&Window
MenuManager: id=help text=&Help

The gap happens between the "Run" and "Window" menus.

The corresponding MMenu (elementId=org.eclipse.ui.main.menu)'s children:

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuImpl@599e80b1 (elementId: file, tags: [], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: &File, iconURI: null, tooltip: null, mnemonics: null) (enabled: true)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuImpl@7ad7aaf9 (elementId: edit, tags: [], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: &Edit, iconURI: null, tooltip: null, mnemonics: null) (enabled: true)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuImpl@62300f65 (elementId: org.eclipse.jdt.ui.source.menu, tags: [], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: false, containerData: null, accessibilityPhrase: null) (label: &Source, iconURI: null, tooltip: null, mnemonics: null) (enabled: true)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuImpl@4142e23f (elementId: org.eclipse.jdt.ui.refactoring.menu, tags: [], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: false, containerData: null, accessibilityPhrase: null) (label: Refac&tor, iconURI: null, tooltip: null, mnemonics: null) (enabled: true)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuImpl@e12eceb (elementId: navigate, tags: [], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: &Navigate, iconURI: null, tooltip: null, mnemonics: null) (enabled: true)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuImpl@79feea8f (elementId: org.eclipse.search.menu, tags: [], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: false, containerData: null, accessibilityPhrase: null) (label: Se&arch, iconURI: null, tooltip: null, mnemonics: null) (enabled: true)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuImpl@ae03a4d (elementId: project, tags: [], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: &Project, iconURI: null, tooltip: null, mnemonics: null) (enabled: true)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuSeparatorImpl@2deec0c5 (elementId: additions, tags: null, contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: false, containerData: null, accessibilityPhrase: null) (label: null, iconURI: null, tooltip: null, mnemonics: null)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuImpl@5f0e6817 (elementId: org.eclipse.ui.run, tags: [menuContribution:menu], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: &Run, iconURI: null, tooltip: null, mnemonics: null) (enabled: true)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuSeparatorImpl@3fe01885 (elementId: navigate, tags: null, contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: null, iconURI: null, tooltip: null, mnemonics: null)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuSeparatorImpl@1169e486 (elementId: edit, tags: null, contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: null, iconURI: null, tooltip: null, mnemonics: null)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuImpl@3d02c002 (elementId: window, tags: [], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: &Window, iconURI: null, tooltip: null, mnemonics: null) (enabled: true)

org.eclipse.e4.ui.model.application.ui.menu.impl.MenuImpl@6aeeefcf (elementId: help, tags: [], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: &Help, iconURI: null, tooltip: null, mnemonics: null) (enabled: true)
Comment 2 DJ Houghton CLA 2011-02-25 10:33:51 EST
I have the same problem in this week's I-build.
(i20110224-2000)
Comment 3 DJ Houghton CLA 2011-05-09 15:32:48 EDT
This is still an issue.
Seems like a good 4.1 polish item since it is something which is obvious to the user.
Comment 4 Brian de Alwis CLA 2011-05-13 16:52:04 EDT
*** Bug 345780 has been marked as a duplicate of this bug. ***
Comment 5 Remy Suen CLA 2011-05-26 19:28:11 EDT
(In reply to comment #1)
> org.eclipse.jface.action.Separator(id=navigate)
> org.eclipse.jface.action.Separator(id=edit)

The 'navigate' one is the culprit. Why the 'edit' one doesn't even get filled in by the menu manager, I'm not sure yet.

The gap is visible on Windows 7 but unlike the Mac cannot be clicked or "hovered" over.
Comment 6 Remy Suen CLA 2011-05-27 08:54:49 EDT
Here we change the 'addition' MMS's "visible" feature from 'false' to 'true'.

Thread [main] (Suspended (breakpoint at line 331 in UIElementImpl))	
	MenuSeparatorImpl(UIElementImpl).setVisible(boolean) line: 331	
	ContributionRecord.updateVisibility(IEclipseContext) line: 65	
	MenuManagerRenderer$6.changed(IEclipseContext) line: 449	
	TrackableComputationExt.update(ContextChangeEvent) line: 91	
	EclipseContext.runAndTrack(RunAndTrack) line: 316	
	MenuManagerRenderer.processAddition(MMenu, MenuManager, MMenuContribution, HashSet<String>, HashSet<String>, boolean) line: 446	
	MenuManagerRenderer.generateContributions(MMenu, ArrayList<MMenuContribution>, boolean) line: 415	
	MenuManagerRenderer.processContributions(MMenu, boolean, boolean) line: 381	
	MenuManagerRenderer.createWidget(MUIElement, Object) line: 312	
	PartRenderingEngine.createWidget(MUIElement, Object) line: 833	
	PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 587	
	PartRenderingEngine$6.run() line: 501	
	SafeRunner.run(ISafeRunnable) line: 42	
	PartRenderingEngine.createGui(MUIElement, Object, IEclipseContext) line: 486	
	WorkbenchWindow.setup() line: 533

Here we create a Separator with id 'additions' when it should be a GroupMarker.

Thread [main] (Suspended)	
	MenuManagerRenderer.processSeparator(MenuManager, MMenuSeparator) line: 620	
	MenuManagerRenderer.modelProcessSwitch(MenuManager, MMenuElement) line: 569	
	MenuManagerRenderer.processContents(MElementContainer<MUIElement>) line: 500	
	PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 599	
	PartRenderingEngine$6.run() line: 501	
	SafeRunner.run(ISafeRunnable) line: 42	
	PartRenderingEngine.createGui(MUIElement, Object, IEclipseContext) line: 486	
	WorkbenchWindow.setup() line: 533
Comment 7 Remy Suen CLA 2011-05-27 09:19:39 EDT
This is where we seem to create a 'navigate' MMC to the main menu bar. Good old fashioned action sets at work here.

<actionSet
    id="org.eclipse.search.searchActionSet"
    label="%search"
    visible="true">
    
    <menu
        id="org.eclipse.search.menu"
        label="%searchMenu.label"
        path="navigate">
        <groupMarker name="internalDialogGroup"/>
        <groupMarker name="dialogGroup"/>
        <separator name="fileSearchContextMenuActionsGroup"/>
        <separator name="contextMenuActionsGroup"/>
        <separator name="occurencesActionsGroup"/>
        <separator name="extraSearchGroup"/>
    </menu>

Thread [main] (Suspended)	
	MenuSeparatorImpl(UIElementImpl).setVisible(boolean) line: 329	
	ActionSet.contributeMenuGroup(ArrayList<MMenuContribution>, String, String) line: 277	
	ActionSet.addContribution(String, ArrayList<MMenuContribution>, IConfigurationElement, boolean, String) line: 239	
	ActionSet.addToModel(ArrayList<MMenuContribution>, ArrayList<MToolBarContribution>, ArrayList<MTrimContribution>) line: 99	
	MenuPersistence.readActionSets() line: 202	
	MenuPersistence.read() line: 120	
	WorkbenchMenuService.readRegistry() line: 117
Comment 8 Paul Webster CLA 2011-05-27 10:06:00 EDT
Created attachment 196760 [details]
Patch to honour group markers v01

Make sure that the visibility of an actionSet doesn't turn group markers into separators.

PW
Comment 9 Paul Webster CLA 2011-05-27 10:23:08 EDT
Created attachment 196763 [details]
Patch to honour group markers v02

Capture the "additions" marker.
PW
Comment 10 Remy Suen CLA 2011-05-27 10:33:14 EDT
(In reply to comment #9)
> Created attachment 196763 [details]
> Patch to honour group markers v02

I have verified that the "additions", "edit", and "navigate" jface separators in the main menu's menu manager has now been turned into group markers correctly (which is what they are in 3.x).

The model is still "bad" though.
Comment 11 Paul Webster CLA 2011-05-27 10:40:59 EDT
(In reply to comment #9)
> Created attachment 196763 [details]
> Patch to honour group markers v02

Released to HEAD, the group markers should really be group markers.

PW
Comment 12 Paul Webster CLA 2011-05-27 15:29:44 EDT
(In reply to comment #11)
> 
> Released to HEAD, the group markers should really be group markers.

Tested this on DJs system, it really does get rid of the empty menubar space.

PW
Comment 13 Remy Suen CLA 2011-05-27 17:30:44 EDT
As an additional point of reference, my inner also looks good on Windows 7.