edu.rice.comp211.laundry.ui
Class DynamicAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by edu.rice.comp211.laundry.ui.DynamicAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public class DynamicAction
extends AbstractAction

Implementation of Action that invokes a method on an Object.

Version:
$Revision$
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, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
DynamicAction(Object target, String methodName, Object... args)
          Creates a dynamic action with the specified arguments.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Action method.
 
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

DynamicAction

public DynamicAction(Object target,
                     String methodName,
                     Object... args)
Creates a dynamic action with the specified arguments. When the actionPerformed method is invoked on this class the method identified by methodName is invoked with the specified arguments.

Parameters:
target - the Object to invoke the method on
methodName - name of the method to invoke
args - the arguments to pass to the method
Throws:
IllegalArgumentException - if target or methodName is null
Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
Action method. When invoked this will invoke the named method on the object passed to the constructor.

Parameters:
e - the ActionEvent