Bug 205496

Summary: [Commands] Explicitly adding dynamic contributions makes them show up twicw
Product: [Eclipse Project] Platform Reporter: Tod Creasey <Tod_Creasey>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Bug Depends on:    
Bug Blocks: 205497    

Description Tod Creasey CLA 2007-10-04 14:46:01 EDT
M2

In the init code for my view I have the following:

//Add in the entries common to all markers views
		IMenuService menuService = (IMenuService) getSite()
				.getService(IMenuService.class);
		menuService.populateContributionManager((ContributionManager) getSite()
				.getActionBars().getMenuManager(), "menu:" //$NON-NLS-1$
				+ MarkerSupportRegistry.ALL_MARKERS_ID);
		menuService.populateContributionManager((ContributionManager) getSite()
				.getActionBars().getToolBarManager(),
				"toolbar:" + MarkerSupportRegistry.ALL_MARKERS_ID); //$NON-NLS-1$

ALL_MARKERS_ID is a faked out id designed to be something you can look up to add entries to several views. The problem is that when you do this you get 2 calls to fill so every entry gets added twice.
Comment 1 Tod Creasey CLA 2007-10-04 16:08:39 EDT
I found that when I just copied and pasted I got four entries for each one - it looks like it shares the dynamic handler and just loads it multiple times.
Comment 2 Tod Creasey CLA 2007-10-04 16:31:13 EDT
I now have a fairly lightweight workaround to this one so it is not really blocking me,
Comment 3 Tod Creasey CLA 2008-02-08 16:12:05 EST
This is going to require to add unneccessary API in M6 if we don't resolve it by then - what is the status?
Comment 4 Paul Webster CLA 2008-03-31 15:04:02 EDT
There is an internal hack, the same one that PopupMenuExtender uses so that the second populate call only recursively fills newly added items, not all sub contribution managers.  There wasn't time to refine this API for M6


Let me know what you want to do.

PW
Comment 5 Paul Webster CLA 2009-03-02 11:41:29 EST
Updated as per http://wiki.eclipse.org/Platform_UI/Bug_Triage
PW
Comment 6 Eclipse Webmaster CLA 2019-09-06 16:07:43 EDT
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.