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

Bug 489530

Summary: Provide mechanism for model updates via callbacks at the content-parts.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF MVCAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: cletavernier, nyssen
Version: 0.2.0   
Target Milestone: 4.0.0 (Neon) M6   
Hardware: All   
OS: All   
Whiteboard:

Description Matthias Wienand CLA 2016-03-14 06:38:31 EDT
Currently, the intended way of updating the model when a policy performs manipulations is to subclass that policy and ensure that a model operation is chained to the viusal operation that is created by the policy. This mechanism is cumbersome because it requires subclassing, creating a model operation, chaining the operation, and changing the policy binding. Therefore, a more supportive mechanism should be implemented that simplifies the process.

The individual policies (i.a. FXTransformPolicy & FXResizePolicy) should query the target content parts for implementing specific interfaces (ITransformable, IResizable) that can be used by the policies to construct model operations. This would make subclassing, operation construction, operation chaining, and policy binding changes unnecessary while the old mechanism can still be used. This mechanism should be implemented at least for the policies used within the Logo example. Moreover, the Logo example should make use of the mechanism by implementing the specific interfaces instead of binding specialized policies that chain a model operation.
Comment 1 Alexander Nyßen CLA 2016-03-22 13:26:03 EDT
I pushed the following changes to origin/master:

- Introduced ITransformableContentPart which supports transforming its contents.
- Enhanced transform policies (AbstractTransformPolicy, FXTransformPolicy, and FXTransformConnectionPolicy) to chain a content transform operation within commit, delegating to ITransformableContentPart (newly introduced).
- Enhanced resize policies (AbstractResizePolicy [extracted], FXResizePolicy, FXResizeConnectionPolicy) to chain a content operation within commit, delegating to IResizableContentPart (newly introduced).
- Enhanced bend policies (AbstractBendPolicy [extracted], FXBendConnectionPolicy) to chain a content operation within commit, delegating to IBendableContentPart (newly introduced).
- Refactored zest and logo example to no longer use own transform, resize, and bend policies.

Resolving this as fixed in 4.0.0 M7.
Comment 2 Alexander Nyßen CLA 2016-03-22 15:16:47 EDT
Updated milestone to 4.0.0 M6, as this could be included in a re-promotion.