swingwtx.swing.undo
Class UndoManager

java.lang.Object
  extended byswingwtx.swing.undo.AbstractUndoableEdit
      extended byswingwtx.swing.undo.CompoundEdit
          extended byswingwtx.swing.undo.UndoManager
All Implemented Interfaces:
java.util.EventListener, UndoableEdit, UndoableEditListener

public class UndoManager
extends CompoundEdit
implements UndoableEditListener

UndoManager


Field Summary
 
Fields inherited from class swingwtx.swing.undo.CompoundEdit
edits
 
Fields inherited from class swingwtx.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
UndoManager()
           
 
Method Summary
 boolean addEdit(UndoableEdit undoableEdit)
          Default implementations do nothing.
 boolean canRedo()
           
 boolean canUndo()
           
 boolean canUndoOrRedo()
           
 void discardAllEdits()
          Remove all the edits tracked by this UndoManager
protected  UndoableEdit editToBeRedone()
          Returns the most recent significant UndoableEdit that can be redone
protected  UndoableEdit editToBeUndone()
          Returns the most recent significant UndoableEdit that can be undone
 void end()
           
 int getLimit()
           
 java.lang.String getRedoPresentationName()
           
 java.lang.String getUndoOrRedoPresentationName()
           
 java.lang.String getUndoPresentationName()
           
 void redo()
           
protected  void redoTo(UndoableEdit undoableEdit)
           
 void setLimit(int limit)
           
protected  void trimEdits(int from, int to)
           
protected  void trimForLimit()
           
 void undo()
           
 void undoableEditHappened(UndoableEditEvent undoableEditEvent)
           
 void undoOrRedo()
           
protected  void undoTo(UndoableEdit undoableEdit)
           
 
Methods inherited from class swingwtx.swing.undo.CompoundEdit
die, getPresentationName, isInProgress, isSignificant, lastEdit
 
Methods inherited from class swingwtx.swing.undo.AbstractUndoableEdit
replaceEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UndoManager

public UndoManager()
Method Detail

setLimit

public void setLimit(int limit)

getLimit

public int getLimit()

discardAllEdits

public void discardAllEdits()
Remove all the edits tracked by this UndoManager


undoTo

protected void undoTo(UndoableEdit undoableEdit)
               throws CannotUndoException
Throws:
CannotUndoException

undo

public void undo()
          throws CannotUndoException
Specified by:
undo in interface UndoableEdit
Overrides:
undo in class CompoundEdit
Throws:
CannotUndoException

redoTo

protected void redoTo(UndoableEdit undoableEdit)
               throws CannotRedoException
Throws:
CannotRedoException

redo

public void redo()
          throws CannotRedoException
Specified by:
redo in interface UndoableEdit
Overrides:
redo in class CompoundEdit
Throws:
CannotRedoException

trimEdits

protected void trimEdits(int from,
                         int to)

trimForLimit

protected void trimForLimit()

undoOrRedo

public void undoOrRedo()
                throws CannotRedoException,
                       CannotUndoException
Throws:
CannotRedoException
CannotUndoException

canUndoOrRedo

public boolean canUndoOrRedo()

canUndo

public boolean canUndo()
Specified by:
canUndo in interface UndoableEdit
Overrides:
canUndo in class CompoundEdit

canRedo

public boolean canRedo()
Specified by:
canRedo in interface UndoableEdit
Overrides:
canRedo in class CompoundEdit

addEdit

public boolean addEdit(UndoableEdit undoableEdit)
Description copied from class: AbstractUndoableEdit
Default implementations do nothing. Override in implementing classes

Specified by:
addEdit in interface UndoableEdit
Overrides:
addEdit in class CompoundEdit

end

public void end()
Overrides:
end in class CompoundEdit

getUndoOrRedoPresentationName

public java.lang.String getUndoOrRedoPresentationName()

getUndoPresentationName

public java.lang.String getUndoPresentationName()
Specified by:
getUndoPresentationName in interface UndoableEdit
Overrides:
getUndoPresentationName in class CompoundEdit

getRedoPresentationName

public java.lang.String getRedoPresentationName()
Specified by:
getRedoPresentationName in interface UndoableEdit
Overrides:
getRedoPresentationName in class CompoundEdit

undoableEditHappened

public void undoableEditHappened(UndoableEditEvent undoableEditEvent)
Specified by:
undoableEditHappened in interface UndoableEditListener

editToBeUndone

protected UndoableEdit editToBeUndone()
Returns the most recent significant UndoableEdit that can be undone


editToBeRedone

protected UndoableEdit editToBeRedone()
Returns the most recent significant UndoableEdit that can be redone