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

Bug 450655

Summary: Introduce support for transaction-based execution of operations
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF MVCAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: karsten.thoms
Version: unspecified   
Target Milestone: 3.10.0 (Mars) M3   
Hardware: All   
OS: All   
See Also: https://github.com/eclipse/xtext-xtend/pull/128
Whiteboard:

Description Alexander Nyßen CLA 2014-11-08 09:12:04 EST
We have the requirement that all semantic actions, which are executed within the context of a single interaction, need to be executed on the operation history as an atomic operation (because otherwise they would have to be individually undone/redone).

The mechanism that ensures this currently is as follows:
- all transaction policies implement ITransactional returning an operation within commit(), which encapsulates the semantic action. 
- some concrete interaction policies (e.g. FXRelocateOnDragPolicy) also implement ITransactional and "forward" the operations returned by the transaction policies
- certain tools (e.g. FXClickDragTool) finally wrap everything into a compound operation (and execute it as an atomic action). 

That is, a lot of coupling and delegation is involved. We could improve this by extending the operation history with support for transactions (probably wrapping something around it), and then simply changing responsibilities as follows:

- tools init() and commit() transactions
- transaction policies directly execute operations (within the context of a transaction)
- interaction policies do not have to care about operations
Comment 1 Alexander Nyßen CLA 2014-11-10 05:27:45 EST
Augmented IDomain to allow execution of operations, as well as opening and closing of transactions. Ensure that FXClickDragTool opens and closes a transaction (other tools might also do so in the future). Removed ITransactional implementation from all interaction policies again, and ensured operations are only executed via the domain.

Pushed all changes to origin/master. Resolving as fixed in 3.10.0M3.
Comment 2 Eclipse Genie CLA 2017-01-16 09:28:40 EST
GitHub Pull Request 128 created by [kthoms]
https://github.com/eclipse/xtext-xtend/pull/128
Comment 3 Karsten Thoms CLA 2017-01-16 09:30:52 EST
(In reply to Eclipse Genie from comment #2)
> GitHub Pull Request 128 created by [kthoms]
> https://github.com/eclipse/xtext-xtend/pull/128
Please ignore, wrong bugnumber was referenced in the commit.