com.anthonyeden.lib.gui
Class UndoAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended bycom.anthonyeden.lib.gui.UndoAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable

public class UndoAction
extends javax.swing.AbstractAction

A UI action for undo.

Author:
Anthony Eden
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
UndoAction(javax.swing.undo.UndoManager undoManager)
          Construct a new RedoAction which uses the given UndoManager for managing undos and redos.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Invoked when an ActionEvent occurs.
 void executeUndo()
          Execute the undo.
 void setRedoAction(RedoAction redoAction)
          Set the redo action.
 void updateUndoState()
          Update the undo state in the UndoManager.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UndoAction

public UndoAction(javax.swing.undo.UndoManager undoManager)
Construct a new RedoAction which uses the given UndoManager for managing undos and redos.

Parameters:
undoManager - The UndoManager
Method Detail

setRedoAction

public void setRedoAction(RedoAction redoAction)
Set the redo action. Setting the redo action will allow the undo action to tell the redo action to update its state when an undo occurs.

Parameters:
redoAction - The redo action

executeUndo

public void executeUndo()
Execute the undo. This method is typically invoked when the Action is triggered. It may also be used programatically.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Invoked when an ActionEvent occurs.

Parameters:
e - The ActionEvent

updateUndoState

public void updateUndoState()
Update the undo state in the UndoManager.



Copyright (c) 2000-2003 Anthony Eden. All Rights Reserved.