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

Bug 507264

Summary: Simplify ActivatableSupport contract through lambdas
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF CommonAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0.0   
Target Milestone: 5.0.0 (Oxygen) M4   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2016-11-09 00:54:02 EST
Up to now, all implementers of IActivatable that delegate to ActivatableSupport have to guard themselves against multiple activation/deactivation. This could be simplified by passing in an activation/deactivation callback to activate/deactivate, so the guarding could completely be done within ActivitableSupport.
Comment 1 Alexander Nyßen CLA 2016-11-09 00:57:41 EST
Pushed the following changes to origin/master:

- Add runnable callacks to ActivatableSupport#activate() and deactivate(), which are properly guarded against multiple invocations of activate.
- Ensured all implementers of IActivatable provide doActivate() and doDeactivate() callbacks, that are passed in as arguments.
- Made all delegate functions final in all IActivatable implementers.

Resolving as fixed in 5.0.0 M4.