edu.stanford.nlp.swing
Class MenuSavvyUndoManager

java.lang.Object
  extended byjavax.swing.undo.AbstractUndoableEdit
      extended byjavax.swing.undo.CompoundEdit
          extended byjavax.swing.undo.UndoManager
              extended byedu.stanford.nlp.swing.MenuSavvyUndoManager
All Implemented Interfaces:
EventListener, Serializable, UndoableEdit, UndoableEditListener

public class MenuSavvyUndoManager
extends UndoManager

UndoManager that maintains an undo and redo menu to the current undo state. After an undoable action occurs, or an action is undone/redone, undo/redo menus are updated with current text and set enabled/disabled as needed.

Author:
Joseph Smarr (jsmarr@stanford.edu) [taken from Summer 01 work at UCSD]
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
MenuSavvyUndoManager(JMenuItem undoMenuItem, JMenuItem redoMenuItem)
           
 
Method Summary
 void discardAllEdits()
           
 void redo()
           
 void undo()
           
 void undoableEditHappened(UndoableEditEvent e)
           
 
Methods inherited from class javax.swing.undo.UndoManager
addEdit, canRedo, canUndo, canUndoOrRedo, 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

MenuSavvyUndoManager

public MenuSavvyUndoManager(JMenuItem undoMenuItem,
                            JMenuItem redoMenuItem)
Method Detail

undoableEditHappened

public void undoableEditHappened(UndoableEditEvent e)

undo

public void undo()
          throws CannotUndoException
Throws:
CannotUndoException

redo

public void redo()
          throws CannotUndoException
Throws:
CannotUndoException

discardAllEdits

public void discardAllEdits()


Stanford NLP Group