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.

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: CWAction.java,v 1.5 2005/03/19 18:45:07 dmsmith Exp $
Author:
DM Smith [dmsmith555 at yahoo dot com]
See Also:
Licence, 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-2004