API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.undo. UndoManager View Source
Author(s)
Ray Ryan
Since
Version
1.39, 06/23/06
Serial
Hierarchy
 Object
      AbstractUndoableEdit
          CompoundEdit
              UndoManager
Implements
 UndoableEditListener
Subclasses
Description
public class UndoManager
  UndoManager manages a list of UndoableEdits, providing a way to undo or redo the appropriate edits.
See also:   
Constructors
public UndoManager ()
Creates a new UndoManager.
Methods
Hide/Show inherited methods
publicsynchronized boolean addEdit (UndoableEdit anEdit) [Overrides CompoundEdit]
  Adds an UndoableEdit to this UndoManager, if it's possible.
publicsynchronized boolean canRedo () [Overrides CompoundEdit]
  Returns true if edits may be redone.
publicsynchronized boolean canUndo () [Overrides CompoundEdit]
  Returns true if edits may be undone.
publicsynchronized boolean canUndoOrRedo ()
  Returns true if it is possible to invoke undo or redo.
public void die () [Inherited From CompoundEdit]
Sends die to each subedit, in the reverse of the order that they were added.
publicsynchronized void discardAllEdits ()
  Empties the undo manager sending each edit a die message in the process.
protected UndoableEdit editToBeRedone ()
  Returns the the next significant edit to be redone if redo is invoked.
protected UndoableEdit editToBeUndone ()
  Returns the the next significant edit to be undone if undo is invoked.
publicsynchronized void end () [Overrides CompoundEdit]
  Turns this UndoManager into a normal CompoundEdit.
publicsynchronized int getLimit ()
  Returns the maximum number of edits this UndoManager holds.
public String getPresentationName () [Inherited From CompoundEdit]
  Returns getPresentationName from the last UndoableEdit added to edits.
publicsynchronized String getRedoPresentationName () [Overrides CompoundEdit]
  Returns a description of the redoable form of this edit.
publicsynchronized String getUndoOrRedoPresentationName ()
  Convenience method that returns either getUndoPresentationName or getRedoPresentationName.
publicsynchronized String getUndoPresentationName () [Overrides CompoundEdit]
  Returns a description of the undoable form of this edit.
public boolean isInProgress () [Inherited From CompoundEdit]
  Returns true if this edit is in progress--that is, it has not received end.
public boolean isSignificant () [Inherited From CompoundEdit]
  Returns true if any of the UndoableEdits in edits do.
protected UndoableEdit lastEdit () [Inherited From CompoundEdit]
Returns the last UndoableEdit in edits, or null if edits is empty.
publicsynchronized void redo () throws CannotRedoException [Overrides CompoundEdit]
  Redoes the appropriate edits.
protected void redoTo (UndoableEdit edit) throws CannotRedoException
  Redoes all changes from the index of the next edit to edit, updating the index of the next edit appropriately.
public boolean replaceEdit (UndoableEdit anEdit) [Inherited From AbstractUndoableEdit]
  This default implementation returns false.
publicsynchronized void setLimit (int l)
  Sets the maximum number of edits this UndoManager holds.
public String toString () [Overrides CompoundEdit]
  Returns a string that displays and identifies this object's properties.
protected void trimEdits (int from, int to)
  Removes edits in the specified range.
protected void trimForLimit ()
Reduces the number of queued edits to a range of size limit, centered on the index of the next edit.
publicsynchronized void undo () throws CannotUndoException [Overrides CompoundEdit]
  Undoes the appropriate edits.
public void undoableEditHappened (UndoableEditEvent e) [Specified in UndoableEditListener]
  An UndoableEditListener method.
publicsynchronized void undoOrRedo () throws CannotRedoException CannotUndoException
  Convenience method that invokes one of undo or redo.
protected void undoTo (UndoableEdit edit) throws CannotUndoException
  Undoes all changes from the index of the next edit to edit, updating the index of the next edit appropriately.
Fields
Hide/Show inherited fields
pack-private boolean alive [Inherited From AbstractUndoableEdit]
True if this edit has not received die; defaults to true.
protected Vector<UndoableEdit> edits [Inherited From CompoundEdit]
The collection of UndoableEdits undone/redone en masse by this CompoundEdit.
pack-private boolean hasBeenDone [Inherited From AbstractUndoableEdit]
Defaults to true; becomes false if this edit is undone, true again if it is redone.
pack-private int indexOfNextAdd
pack-private boolean inProgress [Inherited From CompoundEdit]
True if this edit has never received end.
pack-private int limit
protectedfinalstatic String RedoName = "Redo" [Inherited From AbstractUndoableEdit]
  String returned by getRedoPresentationName; as of Java 2 platform v1.3.1 this field is no longer used.
protectedfinalstatic String UndoName = "Undo" [Inherited From AbstractUndoableEdit]
  String returned by getUndoPresentationName; as of Java 2 platform v1.3.1 this field is no longer used.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar