javax.swing
Class JComponent.ActionStandin

java.lang.Object
  extended byjavax.swing.JComponent.ActionStandin
All Implemented Interfaces:
Action, ActionListener, EventListener
Enclosing class:
JComponent

final class JComponent.ActionStandin
extends Object
implements Action

ActionStandin is used as a standin for ActionListeners that are added via registerKeyboardAction.


Field Summary
private  Action action
           
private  ActionListener actionListener
           
private  String command
           
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
(package private) JComponent.ActionStandin(ActionListener actionListener, String command)
           
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Invoked when an action occurs.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChange listener.
 Object getValue(String key)
          Gets one of this object's properties using the associated key.
 boolean isEnabled()
          Returns the enabled state of the Action.
 void putValue(String key, Object value)
          Sets one of this object's properties using the associated key.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChange listener.
 void setEnabled(boolean b)
          Sets the enabled state of the Action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actionListener

private final ActionListener actionListener

command

private final String command

action

private final Action action
Constructor Detail

JComponent.ActionStandin

JComponent.ActionStandin(ActionListener actionListener,
                         String command)
Method Detail

getValue

public Object getValue(String key)
Description copied from interface: Action
Gets one of this object's properties using the associated key.

Specified by:
getValue in interface Action
See Also:
Action.putValue(java.lang.String, java.lang.Object)

isEnabled

public boolean isEnabled()
Description copied from interface: Action
Returns the enabled state of the Action. When enabled, any component associated with this object is active and able to fire this object's actionPerformed method.

Specified by:
isEnabled in interface Action
Returns:
true if this Action is enabled

actionPerformed

public void actionPerformed(ActionEvent ae)
Description copied from interface: ActionListener
Invoked when an action occurs.

Specified by:
actionPerformed in interface ActionListener

putValue

public void putValue(String key,
                     Object value)
Description copied from interface: Action
Sets one of this object's properties using the associated key. If the value has changed, a PropertyChangeEvent is sent to listeners.

Specified by:
putValue in interface Action
Parameters:
key - a String containing the key
value - an Object value

setEnabled

public void setEnabled(boolean b)
Description copied from interface: Action
Sets the enabled state of the Action. When enabled, any component associated with this object is active and able to fire this object's actionPerformed method. If the value has changed, a PropertyChangeEvent is sent to listeners.

Specified by:
setEnabled in interface Action
Parameters:
b - true to enable this Action, false to disable it

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: Action
Adds a PropertyChange listener. Containers and attached components use these methods to register interest in this Action object. When its enabled state or other property changes, the registered listeners are informed of the change.

Specified by:
addPropertyChangeListener in interface Action
Parameters:
listener - a PropertyChangeListener object

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: Action
Removes a PropertyChange listener.

Specified by:
removePropertyChangeListener in interface Action
Parameters:
listener - a PropertyChangeListener object
See Also:
Action.addPropertyChangeListener(java.beans.PropertyChangeListener)