org.pietschy.command.undo
Class UndoContext

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by javax.swing.undo.CompoundEdit
          extended by javax.swing.undo.UndoManager
              extended by org.pietschy.command.undo.UndoContext
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.swing.event.UndoableEditListener, javax.swing.undo.UndoableEdit

public class UndoContext
extends javax.swing.undo.UndoManager
implements javax.swing.event.UndoableEditListener

UndoContext extends UndoManager to provide state change notifications to listners.

Version:
$Revision: 1.4 $
Author:
andrewp
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.undo.CompoundEdit
edits
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
UndoContext()
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
           
 boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
           
 boolean canRedo()
           
 boolean canUndo()
           
 void fireStateChaged()
           
 void redo()
           
 void removeChangeListener(javax.swing.event.ChangeListener l)
           
 void undo()
           
 void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
           
 
Methods inherited from class javax.swing.undo.UndoManager
canUndoOrRedo, discardAllEdits, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, redoTo, setLimit, toString, trimEdits, trimForLimit, undoOrRedo, undoTo
 
Methods inherited from class javax.swing.undo.CompoundEdit
die, getPresentationName, isInProgress, isSignificant, lastEdit
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
replaceEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UndoContext

public UndoContext()
Method Detail

addEdit

public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
Specified by:
addEdit in interface javax.swing.undo.UndoableEdit
Overrides:
addEdit in class javax.swing.undo.UndoManager

undoableEditHappened

public void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
Specified by:
undoableEditHappened in interface javax.swing.event.UndoableEditListener
Overrides:
undoableEditHappened in class javax.swing.undo.UndoManager

undo

public void undo()
Specified by:
undo in interface javax.swing.undo.UndoableEdit
Overrides:
undo in class javax.swing.undo.UndoManager

redo

public void redo()
Specified by:
redo in interface javax.swing.undo.UndoableEdit
Overrides:
redo in class javax.swing.undo.UndoManager

canUndo

public boolean canUndo()
Specified by:
canUndo in interface javax.swing.undo.UndoableEdit
Overrides:
canUndo in class javax.swing.undo.UndoManager

canRedo

public boolean canRedo()
Specified by:
canRedo in interface javax.swing.undo.UndoableEdit
Overrides:
canRedo in class javax.swing.undo.UndoManager

fireStateChaged

public void fireStateChaged()

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener l)