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

Bug 493137

Summary: Fix that ISelectionProvider/SelectionForwarder cannot be properly exchanged.
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF MVCAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.2.0   
Target Milestone: 4.0.0 (Neon) RC1   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2016-05-06 09:13:12 EDT
Up to now, we have a DefaultSelectionProvider, on which a selection can be set, and a SelectionForwarder, which synchronizes the selection of the selection provider with the SelectionModel. As the selection forwarder is not exposed to clients (one can only overwrite its registration within AbstractFXView, not within AbstractFXEditor), there is no chance to change the behavior properly, even if the selection provider is injected.

We should change this, so the ISelectionProvider already performs the synchronization with the SelectionModel. Thereby, clients could easily bind a different implementation of a selection provider in case they need to change the selection synchronization.
Comment 1 Alexander Nyßen CLA 2016-05-06 09:23:18 EDT
I pushed the following changes to origin/master:

- Introduced a new ISelectionProviderFactory that can be used to create an ISelectionProvider for an IWorkbenchPart.
- Merged DefaultSelectionProvider and SelectionForwarder into a single ContentSelectionProvider, which implements ISelectionProvider and synchronizes the selection with a given SelectionModel.
- Removed ISelectionProvider binding from MvcUiModule, and replaced it with an ISelectionProviderFactory binding within MvcFxUiModule, which creates a ContentSelectionProvider based on the content viewer's SelectionModel.
- Removed registerWorkbenchSelectionForwarder() method from AbstractFxView.
- Exposed getDomain() in AbstractFXView and AbstractFxEditor.
- Renamed AbstractEditor.getViewer() into getContentViewer(), so the API resembles that of AbstractFXView.

Resolve as fixed in 4.0.0 RC1.