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

Bug 9333

Summary: [Contributions] updating: Confusion as to which selection provider viewerContributions use
Product: [Eclipse Project] Platform Reporter: Nick Edgar <n.a.edgar>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P5 CC: Darin_Swanson, mistria
Version: 2.0Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Nick Edgar CLA 2002-02-08 17:19:02 EST
Build 20020205

Darin S encountered some difficulties with viewerContributions to an editor's 
context menu.  It seemed like it was getting hooked on the selection provider 
of the editor's site, rather than the one provided to registerContextMenu.

The code in EditorPluginAction.editorChanged, which is called from the 
constructor, calls registerSelectionListener which registers on the part 
site's selection provider.  
This should not be done in the case of viewerContributions, which target a 
specific editor's context menu and aren't retargeted as with 
editorContributions.

It turns out the problem Darin saw was due to something else, but this should 
be investigated.
It seems like if the part site's selection provider is set before the 
viewerContribution's EditorPluginActions are created, and if the plugin is 
active, it will get hooked on this selection provider as well as the one 
passed to registerContextMenu.

Also, PartPluginAction.refreshSelection(IWorkbenchPart) doesn't seem to be 
called from anywhere.
Comment 1 Nick Edgar CLA 2003-02-13 11:05:20 EST
This is actually a contributions issue, unrelated to viewers 
(viewerContributions is a misnomer).
Comment 2 Simon Arsenault CLA 2003-03-12 10:09:06 EST
Defer until after 2.1
Comment 3 Michael Van Meekeren CLA 2006-04-21 13:56:40 EDT
Moving Dougs bugs
Comment 4 Paul Webster CLA 2007-04-05 19:01:14 EDT
Assigning to component owner
PW
Comment 5 Mickael Istria CLA 2016-11-10 11:51:08 EST
viewerContributions have been deprecated in favor of org.eclipse.ui.commands/org.eclipse.ui.menus. No new features or enhancement work will be planned.