com.anthonyeden.lib.gui
Class StandardAction

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

public class StandardAction
extends javax.swing.AbstractAction

The StandardAction class can be used to create a Action object which will invoke the given method on the given target when triggered. The method to be triggered must be a no-argument method.

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
StandardAction(java.lang.Object target, java.lang.String methodName)
          Create a new action.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Event handler method when the action is triggered.
 void addErrorListener(ErrorListener l)
          Add an error listener.
 void removeErrorListener(ErrorListener l)
          Remove an error listener.
 
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

StandardAction

public StandardAction(java.lang.Object target,
                      java.lang.String methodName)
Create a new action.

Parameters:
target - The target object
methodName - The name of the method to invoke
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Event handler method when the action is triggered. This method will invoke the StandardAction's method on the target object. Any errors will be sent to attached ErrorListeners.

Parameters:
evt - The ActionEvent

addErrorListener

public void addErrorListener(ErrorListener l)
Add an error listener.

Parameters:
l - The error listener

removeErrorListener

public void removeErrorListener(ErrorListener l)
Remove an error listener.

Parameters:
l - The error listener


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