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

Bug 479612

Summary: Refactor CreationPolicy, DeletionPolicy and ContentPolicy.
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 / 3.11.0 (Neon) M3   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2015-10-13 02:43:08 EDT
IMHO it is more consistent if we have "elementary" transactional policies only. W.r.t. to FXResizePolicy and FXTransformPolicy we have already achieved this. The CreationPolicy, DeletionPolicy, and ContentPolicy still need some investigation.
Comment 1 Alexander Nyßen CLA 2015-10-27 12:50:00 EDT
Pushed the following changes to origin/master (available for 3.11.0 M3):

- Made ContentPolicy more generic by ensuring it only provides operations that content part will perform on its own content. Moved the unrelated operations into DeletionPolicy.
- Ensured DeletionPolicy (as CreationPolicy) is created on the root part only. Moved a respective binding into MvcModule, which gets overwritten in MvcLogoExampleModule.
- Ensured that FXDeleteFirstAnchorageOnClickPolicy and FXGeometricCurvePart#chainModelChanges() rely on DeletionPolicy rather than content policy.
- Added binding for FXDeleteSelectedOnClickPolicy within MvcLogoExampleModule for root part, so that deleting a multiple selection works as expected.

I will re-investigate CreationPolicy and DeletionPolicy and its usages before resolving  this as fixed.
Comment 2 Alexander Nyßen CLA 2015-10-28 08:51:03 EDT
I added the following changes:

- Ensure DeletionPolicy only handles removal from parent and detachment of anchoreds, as detachment from anchorages is already handled via synchronization (triggered via sync operation).
- Ensure CreationPolicy can also provides facilities to specify anchoreds on creation. This way, the functionality is complementory to DeletionPolicy. 
- Enhanced documentation of ContentPolicy.
Comment 3 Alexander Nyßen CLA 2015-10-29 03:49:49 EDT
What remains is to ensure that CreationPolicy and DeletionPolicy properly deal with selection, hover, and focus updates. I opened bug #480875  to keep track of this and resolve this one as fixed in 3.11.0 M3.