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

Bug 320165

Summary: Contributed main menu item should be hidden when empty
Product: [Eclipse Project] e4 Reporter: Stefan Mücke <s.muecke>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: bokowski
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Stefan Mücke CLA 2010-07-17 09:59:01 EDT
I encountered this bug when running my RCP application on e4. This application adds a placeholder item (like "Tools") to the main menu. By default, this main menu entry has no items, and should therefore not be visible (this works with 3.x).

Note: I am adding this item via an ActionBarAdvisor:

@Override
protected void fillMenuBar(IMenuMananager menuBar) {
    menuBar.add(createToolsMenu());
}
Comment 1 Paul Webster CLA 2010-07-19 09:08:53 EDT
In 4.0 you should get an "(none)" or "(empty)" for that menu item.

PW
Comment 2 Stefan Mücke CLA 2010-07-19 10:37:16 EDT
Yes, the menu contains "(none)". However, the menu item was only meant to appear when certain "internal-use" plugins are installed. Normal users should never get this menu.

Any way to tweak this behavior? (Is this part of the compatibility platform?)
Comment 3 Paul Webster CLA 2010-07-19 10:43:15 EDT
This is currently part of the base e4 behaviour.  All contributions are tied to an SWT.Show event ... but that means that the menu must be visible to show.

PW
Comment 4 Boris Bokowski CLA 2010-07-19 13:07:39 EDT
To fix this, we would have to do for top-level menus what we do for toolbar items (plus probably some code that updates menus one more level down than we currently do). Too much for 4.0 in my opinion.
Comment 5 Paul Webster CLA 2010-07-19 13:14:32 EDT
(In reply to comment #4)
> To fix this, we would have to do for top-level menus what we do for toolbar
> items (plus probably some code that updates menus one more level down than we
> currently do). Too much for 4.0 in my opinion.

Definitely, as we would need to continually process the menu bar entry plus its submenu, so that when a contribution appeared we could make the menu bar entry appear.  This will have a rather high performance cost (and a potential activation cost)

PW
Comment 6 Dani Megert CLA 2013-06-05 10:25:37 EDT
Removing outdated target milestone.
Comment 7 Eclipse Genie CLA 2018-12-23 18:08:39 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 8 Lars Vogel CLA 2019-06-05 07:45:34 EDT
This is a mass change to close all e4 bugs marked with "stalebug" whiteboard.

If this bug is still valid, please reopen and remove the "stalebug" keyword.