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

Bug 398865

Summary: Dynamic menu contribution as sole menu child does not render menu visible
Product: [Eclipse Project] Platform Reporter: Marco Descher <marco>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 4.3   
Target Milestone: 4.3 M6   
Hardware: PC   
OS: Mac OS X   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=398866
Whiteboard:
Attachments:
Description Flags
missing dynamic menu contribution
none
Proposed solution none

Description Marco Descher CLA 2013-01-23 04:53:11 EST
If a dynamic menu contribution element, as realized in Bug 389063 is the sole child of a menu, the menu is not set to visible. The enclosed screenshot demonstrates this bug. As soon as any element (except for a separator) is added, the menu becomes visible.
Comment 1 Marco Descher CLA 2013-01-23 04:53:29 EST
Created attachment 225971 [details]
missing dynamic menu contribution
Comment 2 Marco Descher CLA 2013-01-23 09:57:57 EST
Created attachment 225984 [details]
Proposed solution

The enclosed patch solves the problem as follows:

If a menu is instantiated there was up to now no reaction if the only element within this menu was a dynamic menu contribution. Due to this the menu was not shown. If a dynamic menu contribution is now part of a menu, a dummy IContributionItem returning isVisible()==true is added to the menu manager in order to force visibility.

This has to be done in any case, as it is not possible to determine whether a dynamic menu contribution will really contain elements, so we have to show the menu.
Comment 3 Marco Descher CLA 2013-01-26 04:11:52 EST
The solution of Bug 398866 will also solve this problem.
Comment 4 Paul Webster CLA 2013-02-28 11:44:34 EST
Fixed by bug 398866

PW
Comment 5 Paul Webster CLA 2013-03-12 12:44:58 EDT
In 4.3.0.I20130311-2000
PW