com.pietschy.command.undo
Class UndoCommand

java.lang.Object
  extended by com.pietschy.command.Command
      extended by com.pietschy.command.ActionCommand
          extended by com.pietschy.command.undo.AbstractUndoCommand
              extended by com.pietschy.command.undo.UndoCommand
All Implemented Interfaces:
ActionCommandExecutor, Bindable, Identifiable

public class UndoCommand
extends AbstractUndoCommand

Causes the last edit of the current UndoContext to be undone.


Field Summary
 
Fields inherited from class com.pietschy.command.ActionCommand
PARAMETER_ACTION_EVENT, PARAMETER_INVOKER, PARAMETER_INVOKER_WINDOW, PARAMETER_MODIFIERS
 
Fields inherited from class com.pietschy.command.Command
internalLog, PROPERTY_ENABLED, PROPERTY_VISIBLE
 
Constructor Summary
UndoCommand()
          Creates a new anonymous instance.
UndoCommand(java.lang.String id)
          Creates an instance with the specified id.
 
Method Summary
protected  void handleExecute()
          Invokes UndoContext.undo().
protected  void updateState()
          Invoked on changes to the CommandContainer heirarchy to update the state of this command.
 
Methods inherited from class com.pietschy.command.undo.AbstractUndoCommand
bindToContainer, containerStateChanged, getUndoContext, setUndoContext, unbindFromContainer
 
Methods inherited from class com.pietschy.command.ActionCommand
addActionCommandListener, addInterceptor, createButton, createButton, createButton, createButton, createMenuItem, createMenuItem, createMenuItem, createMenuItem, doButtonAttachments, doButtonDetachments, execute, execute, getActionAdapter, getActionAdapter, getActionEvent, getInvoker, getInvokerWindow, getModifiers, getParameter, getParameter, getParameters, installShortCut, installShortCut, postExecute, preExecute, putParameter, putParameters, removeActionCommandListener, removeInterceptor, requestDefaultIn, uninstallShortCut, uninstallShortCut
 
Methods inherited from class com.pietschy.command.Command
addContainerPropertyListener, addFace, addHoverListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, attach, bind, bind, bind, buttonIterator, configureAppearance, configureAppearances, configureButtonAppearances, configureButtonStates, configureButtonStates, createButton, createButton, createButton, createButton, createComponent, createMenuItem, createMenuItem, createMenuItem, createMenuItem, detach, faceExists, findBestFace, fireHoverEnded, fireHoverStarted, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlternativeFaceContexts, getButtonFactory, getButtonIn, getCommandContainer, getContainerProperty, getDefaultFace, getDefaultFace, getFace, getFace, getId, getMenuFactory, getProperty, getProperty, getPropertyNames, getToolbarFactory, isAnonymous, isAttachedTo, isBound, isEnabled, isVisible, loadConfiguration, notifyCommandContainerHierarchyChanged, putProperties, putProperty, rebind, removeContainerPropertyListener, removeHoverListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, requestFocusIn, setButtonFactory, setEnabled, setMenuFactory, setToolbarFactory, setVisible, toString, unbind, validateId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.pietschy.command.ActionCommandExecutor
addPropertyChangeListener, addPropertyChangeListener, isEnabled, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface com.pietschy.command.Identifiable
getId
 

Constructor Detail

UndoCommand

public UndoCommand()
Creates a new anonymous instance.


UndoCommand

public UndoCommand(java.lang.String id)
Creates an instance with the specified id.

Parameters:
id - the command id.
Method Detail

updateState

protected void updateState()
Invoked on changes to the CommandContainer heirarchy to update the state of this command. The command will enable if the UndoContext is non null and UndoManager.canUndo() returns true.

Specified by:
updateState in class AbstractUndoCommand

handleExecute

protected void handleExecute()
Invokes UndoContext.undo().

Specified by:
handleExecute in class ActionCommand


Copyright © 2006 - 2007 Andrew Pietsch