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

Bug 452677

Summary: Investigate removal of AbstractFXContentPart.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF MVCAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 453119    
Bug Blocks:    

Description Matthias Wienand CLA 2014-11-21 11:21:54 EST
The AbstractFXContentPart does not provide sufficient functionality to justify its existence. Moreover, the user should be able to implement the controller logic independent from the rendering toolkit in-use. This can be accomplished by a layer of abstract content parts with a type parameter to specify their visual. So that only the visual-specific aspects have to be implemented in sub-classes.

Unfortunately, the AbstractFXContentPart specifies a #getAnchor() method which returns a JavaFX-specific object, and this method is used in the FXBendPolicy. Therefore, in order to remove the AbstractFXContentPart, the #getAnchor() method could be replaced with an adapter based mechanism (i.e. Provider<IFXAnchor>).
Comment 1 Alexander Nyßen CLA 2014-11-24 16:20:22 EST
In either way we need to refactor the #getAnchor() mechanism. Up to now, casts to the AbstractFXContentPart class are required. We should ensure, this can be handled properly through the IVisualPart interface. Best would probably be to register a Provider<IFXAnchor> for this purpose. However, to properly do so, we will first offer support for using parameterized types as adapter keys (see bug #453119).
Comment 2 Alexander Nyßen CLA 2014-12-01 08:24:17 EST
Implemented the following changes to get rid of dependencies to the abstract base implementation AbstractFXContentPart. 
- Removed getAnchor() method from AbstractFXContentPart. 
- Created ChopBoxAnchorProvider implementation.
- Ensured a Provider<? extends IFXAnchor> is now queried to retrieve an anchor implementation by default.

These changes are pushed to origin/master and will be available in 3.10.0M4.
Comment 3 Alexander Nyßen CLA 2014-12-02 04:35:09 EST
With the changes applied as part of bug #450250, AbstractFXContentPart does no longer provide any own functionality (it only binds the VR parameter to Node). However, within MvcFxModule, there are still default bindings defined for it.
Comment 4 Alexander Nyßen CLA 2015-04-26 05:26:46 EDT
As we have now placed the responsibility to register/unregister nested visuals within AbstractFXContentPart, resolving this as WONTFIX.