Bug 177587 - MonitorViewPage SelectionProvider
Summary: MonitorViewPage SelectionProvider
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-03-15 12:32 EDT by Andrey Asadchev CLA
Modified: 2011-05-25 07:50 EDT (History)
1 user (show)

See Also:


Attachments
Made the SystemMonitorViewPart a SelectionProvider that wraps the table viewers selection provider (7.70 KB, patch)
2007-06-15 16:28 EDT, Kevin Doyle CLA
mober.at+eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Asadchev CLA 2007-03-15 12:32:20 EDT
Build ID: I20070209-1006

Steps To Reproduce:
1. Open two different tabs in Monitor or Table
2. Only elements in the last opened tab will be shown in Properties View.


More information:
MonitorViewPage chanages selection provider in onFocus but that does not work.  For the correct behavior the ViewPart should be the site selection provider, listen to selection change events in tabs and pass the events to the site.
Comment 1 Kevin Doyle CLA 2007-06-11 10:53:54 EDT
To make this change will require API changes to the SystemMonitorViewPart.  It will now have to implement ISelectionProvider and be a wrapper for the proper selection provider.  It will also have to add a setActiveViewerSelectionProvider() method, so the proper selection provider for the active viewer is known.

From: http://www.eclipse.org/articles/Article-WorkbenchSelections/article.html

"Be aware that the part's site accepts a single selection provider only, which should be registered within the createPartControl()  method only:

    getSite().setSelectionProvider(provider);

Replacing the selection provider during the lifetime of the part is not properly supported by the workbench. If a part contains multiple viewers providing selections, like the "Java Hierarchy" view does, a intermediate ISelectionProvider implementation has to be provided that allows dynamically delegating to the currently active viewer within the part. "
Comment 2 Martin Oberhuber CLA 2007-06-12 05:40:34 EDT
not important enough for 2.0, IMHO
Comment 3 Kevin Doyle CLA 2007-06-15 16:28:14 EDT
Created attachment 71516 [details]
Made the SystemMonitorViewPart a SelectionProvider that wraps the table viewers selection provider

Made the SystemMonitorViewPart a SelectionProvider that wraps the table viewers selection provider and updated the widgetSelected method so that it updated the wrapped provider when clicking on tabs in the Monitor.

Legal Message: I, Kevin Doyle, declare that I developed attached code from
scratch, without referencing any 3rd party materials except material licensed
under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this
contribution under the EPL.
Comment 4 David McKnight CLA 2007-06-28 15:54:23 EDT
I've applied the patch and committed it to cvs. Thanks Kevin!
Comment 5 David McKnight CLA 2007-06-28 15:55:00 EDT
marking as fixed