+ /**
+ * Start a time-limited undoable operation. After the operation {@link #stopUndo()}
+ * must be called, which will restore the previous undo description into effect.
+ * Only one level of start-stop undo descriptions is supported, i.e. start-stop
+ * undo cannot be nested, and no other undo operations may be called between
+ * the start and stop calls.
+ *
+ * @param description Description of the following undoable operations.
+ */
+ public void startUndo(String description) {
+ storedDescription = nextDescription;
+ addUndoPosition(description);
+ }
+
+ /**
+ * End the previous time-limited undoable operation. This must be called after
+ * {@link #startUndo(String)} has been called before any other undo operations are
+ * performed.
+ */
+ public void stopUndo() {
+ addUndoPosition(storedDescription);
+ storedDescription = null;
+ }
+
+