-1

I'm searching for a good way to implement undo and redo functionality in an Eclipse E4 application. The undo-redo function need to be undo all the changes of the user on the current MPart. In that MPart it can be on a table change, field change, ...

I have currently three different handlers to execute a insert, update or delete action. All of those handlers implements a interface with methods execute, undo and redo. Are there some default Eclipse Handlers to undo an action provided in some other handlers? So in other words an button in the toolbar that dynamically call the undomanager (object that manages the actions of that specific MPart) of that specific MPart.

JimmyD
  • 2,629
  • 4
  • 29
  • 58
  • take a look into: http://meta.stackoverflow.com/questions/284236/why-is-can-someone-help-me-not-an-actual-question/284237#284237 for posing good questions. Take a look into https://en.wikipedia.org/wiki/Command_pattern for undo/redo functionality. But seeing your question, I suppose it might be too overwhelming. – Pieter De Bie Sep 28 '16 at 13:09
  • Undo/Redo what? For editor style parts you can use the undo/redo code in JFace. – greg-449 Sep 28 '16 at 13:21

1 Answers1

0

I used two buttons on the toolbar to undo or redo some actions from a specific MPart.

The undo and redo functions are in an Interface and need to be implemented in all the action classes.

The implementation is based on this example: http://www.algosome.com/articles/implementing-undo-redo-java.html

JimmyD
  • 2,629
  • 4
  • 29
  • 58