Class UndoableEdit
java.lang.Object
com.codename1.util.UndoableEdit
- Direct Known Subclasses:
ComponentEdit
One step an UndoHistory can take back and apply again.
An edit is recorded after the change it describes was made, so undo is
called first. Both methods must leave the edited object exactly as it was
before, or after, the original change: a history replays them in order and
each relies on the state the previous one left.
This is a class rather than an interface so that later capabilities can be added here with a default that keeps every existing edit working.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()A short name for the change, such as "Move" or "Delete", for an "Undo Move" menu item.booleanisAlive()False once what this edit changes can no longer take it, for instance after the component it was made in was given another document.abstract voidredo()Makes the change again, afterundo.abstract voidundo()Takes the change back.
-
Constructor Details
-
UndoableEdit
public UndoableEdit()
-
-
Method Details
-
undo
public abstract void undo()Takes the change back. -
redo
public abstract void redo()Makes the change again, afterundo. -
getName
A short name for the change, such as "Move" or "Delete", for an "Undo Move" menu item. Null by default. -
isAlive
public boolean isAlive()False once what this edit changes can no longer take it, for instance after the component it was made in was given another document. A history passes over such an edit and forgets it. True by default.
-