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

Bug 517356

Summary: Replace IViewerDependent with IAdaptable.Bound<IViewer>
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: 1.0.0   
Target Milestone: 5.0.0 (Oxygen) RC2   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2017-05-29 05:19:32 EDT
The viewer actions introduced in the Oxygen development stream make use of a specific IViewerDependent abstraction. This is a bit cumbersome. We could simply rely on the adapter mechanism for this purpose and make our actions Adaptable.Bound<IViewer>. Further, AbstractFXEditor should probably be responsible of creating and disposing actions, so it can properly register/unregister them from the content viewer. The FXEditorActionBarContributor could simply reuse the editor actions and register those of the currently active editor as global action handlers.
Comment 1 Alexander Nyßen CLA 2017-05-29 05:34:58 EDT
I pushed the following changes to origin/master:

- Ensured that AbstractViewerAction, AbstractViewerContributionItem, and AbstractViewerActionGroup are IAdaptable.Bound<IViewer> at the content viewer.
- Removed IViewerAction abstraction, which is not needed.
- Ensured that AbstractFXEditor creates and disposes the global delete and selectAll actions, and that the FXEditorActionBarContributor is only responsible for setting the global action handler to the specific action implementation of the editor. This way, the disposal of actions is performed in a more consistent manner (similar for view and editor).

Resolving as fixed in 5.0.0 RC2.