Undo/Redo with Eclipse-Databinding and without EMF

618 views Asked by At

What is the common way to implement undo/redo when using Eclipse-Databinding in an Eclipse Application? When I search at Google, everybody advice to use EMF, but EMF is restricted at my company. I know the use of operations and so on, but at which point I should generate them when using Databinding?

1

There are 1 answers

0
Tom Seidel On

A undo/redo functionality requires mostly something like operations, if you use Eclipse there is already a construct to wrap an amount of work within an operation with undo/redo structures. But if you use databinding, the most important part is that you have to implement your own target-observables that are initializing and executing the operations (e.g you cannot use BeansObservables because databinding is simply calling a setter on your target, not an operation.

Long story short: You have to duplicate what is implemented in the Bundle org.eclipse.emf.databinding.edit and replacing the EMF commands and the commandstack with your own Operations and command-stack. This bundle gives you a good overview what and where needs to be implemented and how this can be achieved...