org.crosswire.common.swing
Class CWAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.crosswire.common.swing.CWAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public class CWAction
extends AbstractAction

A CrossWire Action is a generic extension of AbstractAction, that adds LARGE_ICON to Action and also forwards the Action to its listeners after modifying the ActionEvent to include the ACTION_COMMAND_KEY.

Author:
DM Smith [dmsmith555 at yahoo dot com]
See Also:
for license details. The copyright to this program is held by it's authors., Serialized Form

Field Summary
static String LARGE_ICON
          The icon to display when a large one is needed.
private  EventListenerList listeners
           
private static long serialVersionUID
          Serialization ID
 
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
CWAction()
           
 
Method Summary
 void actionPerformed(ActionEvent evt)
          Forwards the ActionEvent to the registered listener.
 void addActionListener(ActionListener listener)
          Adds a listener for Action events.
 void removeActionListener(ActionListener listener)
          Remove an ActionListener
 String toString()
          String representation of this object suitable for debugging
 
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, wait, wait, wait
 

Field Detail

LARGE_ICON

public static final String LARGE_ICON
The icon to display when a large one is needed. This is still not part of Java as of 1.5

See Also:
Constant Field Values

listeners

private EventListenerList listeners

serialVersionUID

private static final long serialVersionUID
Serialization ID

See Also:
Constant Field Values
Constructor Detail

CWAction

public CWAction()
Method Detail

actionPerformed

public void actionPerformed(ActionEvent evt)
Forwards the ActionEvent to the registered listener.

Parameters:
evt - ActionEvent

addActionListener

public void addActionListener(ActionListener listener)
Adds a listener for Action events.

Parameters:
listener - ActionListener to add

removeActionListener

public void removeActionListener(ActionListener listener)
Remove an ActionListener

Parameters:
listener - ActionListener to remove

toString

public String toString()
String representation of this object suitable for debugging

Overrides:
toString in class Object

Copyright ยจ 2003-2006