The class org.pentaho.reportdesigner.lib.client.undo.Undo is used to collect changes of the report model on an undo stack and is used to undo/redo the changes on the stack.
The main-method of the Undo class contains some sample code.
The commands UndoCommand and RedoCommand are used to revert/redo changes.
The undo contains the changes as a liked linked list of UndoEntry objects.
An UndoListener can be added to listen for changes.
...
An UndoEntry holds a reference to the element and the value of the operation and a . A reference to the UndoEntry is held for a long time in the undo stack. Ensure to only add small objects to the undo stack.
Every element containing large cached data should dispose the cached data when the element is removed from the visual report. E.g deleting a StaticImageReportElement disposes the temporary image to prevent OOM exceptions.
The undo stack is currently limit to 10000 undo operationslimited to 10000 UndoEntry objects. The complete oldest transaction is removed as soon as the limit of 10000 UndoEntries is exceeded.
The text/key used in the startTransaction method is currently not used but might be useful to extend the Undo/RedoCommand to show the operation.
...