From 2c4d54e6d07a0b3aab74c0a5bafe55f49dabb86d Mon Sep 17 00:00:00 2001
From: Michael Koch The use of a UndoableEdits
.
*
* CompoundEdit
is divided in two separate
- * phases.
- *
- * CompoundEdit
is
- * initialized. After a new instance of CompoundEdit
has
- * been created, {@link #addEdit(UndoableEdit)} is called for each
- * element of the compound. To terminate the initialization phase,
- * call {@link #end()}.
CompoundEdit
is
+ * initialized. After a new instance of CompoundEdit
has
+ * been created, {@link #addEdit(UndoableEdit)} is called for each
+ * element of the compound. To terminate the initialization phase,
+ * call {@link #end()}.CompoundEdit
can be
- * used, typically by invoking {@link #undo()} and {@link
- * #redo()}.The following example shows how to use this class. + *
The following example shows how to use this class.
* - *Foo foo; // class Foo implements {@link StateEditable} - * StateEdit edit; + ** *+ * Foo foo; // class Foo implements {@link StateEditable} + * StateEdit edit; * - * edit = new StateEdit(foo, "Name Change"); - * foo.setName("Jane Doe"); - * edit.end(); - * undoManager.addEdit(edit);+ * edit = new StateEdit(foo, "Name Change"); + * foo.setName("Jane Doe"); + * edit.end(); + * undoManager.addEdit(edit); + *
If Foo
’s implementation of {@link
* StateEditable} considers the name as part of the editable state,
* the user can now choose “Undo Name Change” or
* “Redo Name Change” from the respective menu. No
- * further undo support is needed from the application.
+ * further undo support is needed from the application.
The following explains what happens in the example. - * - *
StateEdit
is created, the associated
- * {@link StateEditable} gets asked to store its state into a hash
- * table, {@link #preState}.The following explains what happens in the example.
* + *StateEdit
is created, the associated
+ * {@link StateEditable} gets asked to store its state into a hash
+ * table, {@link #preState}.StateEdit
. The end()
method
- * does two things.
- *
- * StateEdit
now removes
- * any entries from {@link #preState} and {@link #postState} that have
- * the same key, and whose values are equal. Equality is determined
- * by invoking the equals
method inherited from
- * {@link java.lang.Object}.StateEdit
. The end()
method
+ * does two things.
*
+ * StateEdit
now removes
+ * any entries from {@link #preState} and {@link #postState} that have
+ * the same key, and whose values are equal. Equality is determined
+ * by invoking the equals
method inherited from
+ * {@link java.lang.Object}.StateEdit
,
* the edited object is asked to {@linkplain StateEditable#restoreState
* restore its state} from the {@link #preState} table. Similarly,
* when the user chooses to redo the StateEdit
,
* the edited object gets asked to restore its state from the {@link
- * #postState}.