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

Bug 486474

Summary: Menu are not correctly filled calling menu service
Product: [Eclipse Project] Platform Reporter: Vincent Lorenzo <vincent.lorenzo>
Component: UIAssignee: Kalyan Prasad Tatavarthi <kalyan_prasad>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: fanch.bonnabesse, kalyan_prasad, nifauvergue
Version: 4.6   
Target Milestone: 4.6 M6   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/68188
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=df1a6b461f7ea228edf320f0a2072a5f5d06cd13
Whiteboard:
Bug Depends on:    
Bug Blocks: 481727, 483357    
Attachments:
Description Flags
An example outside of Papyrus to reproduce the problem
none
the correct result with the first right click
none
the result for the 2nd and others clicks none

Description Vincent Lorenzo CLA 2016-01-25 08:44:22 EST
In Papyrus, we create menu and menu contribution using the ID of the Menu. In some case, we don't have access to the editor site to register the menu contribution. So we try to fill the menu using a MenuListener and this code : 

class MenuListener implements IMenuListener {

		@Override
		public void menuAboutToShow(IMenuManager manager) {

			final IMenuService menuService = PlatformUI.getWorkbench().getService(IMenuService.class);
			if (menuService != null && manager instanceof MenuManager) {
				menuService.populateContributionManager((MenuManager) manager, menuLocation);
			}

		}
	}
	
	Unfortunately, the menu is correctly filled for the first right click, but not for the next right click. 
	
I add the code in attachment.
Comment 1 Vincent Lorenzo CLA 2016-01-25 08:45:44 EST
Created attachment 259361 [details]
An example outside of Papyrus to reproduce the problem

An example outside of Papyrus to reproduce the problem
Comment 2 Vincent Lorenzo CLA 2016-01-25 08:46:13 EST
Created attachment 259362 [details]
the correct result with the first right click

the correct result with the first right click
Comment 3 Vincent Lorenzo CLA 2016-01-25 08:47:21 EST
Created attachment 259363 [details]
the result for the 2nd and others clicks

the result for the 2nd and others click. Some menu are not here!
Comment 4 Vincent Lorenzo CLA 2016-03-08 05:21:00 EST
I put it in critical hoping getting at least an help on this subject.
Comment 5 Eclipse Genie CLA 2016-03-11 02:19:00 EST
New Gerrit change created: https://git.eclipse.org/r/68188
Comment 6 Vincent Lorenzo CLA 2016-03-11 07:27:41 EST
Hi, thank you for the fix. Do you know if it will be available in the Neon M6 Milestones ?
Comment 8 Eric Moffatt CLA 2016-03-11 10:28:48 EST
Thanks Kalyan...
Comment 9 Kalyan Prasad Tatavarthi CLA 2016-03-16 03:04:24 EDT
Verified in Eclipse Integration Build I20160315-2000