org.browsecode.helpers.undo
Class UndoHandler

java.lang.Object
  extended by org.browsecode.helpers.undo.UndoHandler
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.UndoableEditListener, HasMenus

public class UndoHandler
extends java.lang.Object
implements javax.swing.event.UndoableEditListener, HasMenus

For sample code, see TextComponentDemo Note: do not add this to more than one MenuBarHelper -- it will only work correctly with one at a time.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.browsecode.helpers.menus.HasMenus
HasMenus.ActiveListener
 
Field Summary
protected  org.browsecode.helpers.undo.UndoHandler.RedoAction redoAction
           
protected  org.browsecode.helpers.undo.UndoHandler.UndoAction undoAction
           
protected  javax.swing.undo.UndoManager undoManager
           
 
Constructor Summary
UndoHandler()
           
 
Method Summary
 void addActiveListener(HasMenus.ActiveListener listener)
           
 void addMenusTo(MenuBarHelper menuBarHelper)
           
 void addUndoableEdit(javax.swing.undo.UndoableEdit undoableEdit)
           
 void addUndoableEdit(UndoableEdit2 edit)
           
 java.lang.String getFirstTimeUndoWarning()
           
 javax.swing.Action getRedoAction()
           
 javax.swing.Action getUndoAction()
           
 boolean quit()
           
 void setFirstTimeUndoWarning(java.lang.String s)
           
 void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

undoAction

protected org.browsecode.helpers.undo.UndoHandler.UndoAction undoAction

redoAction

protected org.browsecode.helpers.undo.UndoHandler.RedoAction redoAction

undoManager

protected javax.swing.undo.UndoManager undoManager
Constructor Detail

UndoHandler

public UndoHandler()
Method Detail

getUndoAction

public javax.swing.Action getUndoAction()

getRedoAction

public javax.swing.Action getRedoAction()

setFirstTimeUndoWarning

public void setFirstTimeUndoWarning(java.lang.String s)

getFirstTimeUndoWarning

public java.lang.String getFirstTimeUndoWarning()

addUndoableEdit

public void addUndoableEdit(javax.swing.undo.UndoableEdit undoableEdit)

addUndoableEdit

public void addUndoableEdit(UndoableEdit2 edit)

undoableEditHappened

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

addMenusTo

public void addMenusTo(MenuBarHelper menuBarHelper)
Specified by:
addMenusTo in interface HasMenus

addActiveListener

public void addActiveListener(HasMenus.ActiveListener listener)
Specified by:
addActiveListener in interface HasMenus

quit

public boolean quit()