org.jminor.common.ui.control
Class Control

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.jminor.common.ui.control.Control
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
AbstractValueLink, ControlSet, MethodControl

public class Control
extends AbstractAction

A beefed up Action.

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
Control()
          Constructs a new Control.
Control(String name)
          Constructs a new Control.
Control(String name, StateObserver enabledState)
          Constructs a new Control.
Control(String name, StateObserver enabledState, Icon icon)
          Constructs a new Control.
 
Method Summary
 void actionPerformed(ActionEvent e)
          
 String getDescription()
           
 StateObserver getEnabledState()
           
 Icon getIcon()
           
 int getMnemonic()
           
 String getName()
           
 boolean isEnabled()
          
 Control setDescription(String description)
           
 void setEnabled(boolean newValue)
          
 Control setIcon(Icon icon)
           
 Control setKeyStroke(KeyStroke ks)
           
 Control setMnemonic(int key)
           
 Control setName(String name)
           
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Control

public Control()
Constructs a new Control.


Control

public Control(String name)
Constructs a new Control.

Parameters:
name - the control name

Control

public Control(String name,
               StateObserver enabledState)
Constructs a new Control.

Parameters:
name - the control name
enabledState - the state observer dictating the enable state of this control

Control

public Control(String name,
               StateObserver enabledState,
               Icon icon)
Constructs a new Control.

Parameters:
name - the control name
enabledState - the state observer dictating the enable state of this control
icon - the icon
Method Detail

isEnabled

public final boolean isEnabled()

Specified by:
isEnabled in interface Action
Overrides:
isEnabled in class AbstractAction

setEnabled

public final void setEnabled(boolean newValue)

Specified by:
setEnabled in interface Action
Overrides:
setEnabled in class AbstractAction

actionPerformed

public void actionPerformed(ActionEvent e)


getDescription

public final String getDescription()
Returns:
the description

setDescription

public final Control setDescription(String description)
Parameters:
description - the description string
Returns:
this control instance

getName

public final String getName()
Returns:
the name

setName

public final Control setName(String name)
Parameters:
name - the name of this Control instance
Returns:
this Control instance

getEnabledState

public final StateObserver getEnabledState()
Returns:
the state which controls whether this Control instance is enabled

setMnemonic

public final Control setMnemonic(int key)
Parameters:
key - the mnemonic to associate with this Control instance
Returns:
this Control instance

getMnemonic

public final int getMnemonic()
Returns:
the mnemonic

setKeyStroke

public final Control setKeyStroke(KeyStroke ks)
Parameters:
ks - the KeyStroke to associate with this Control
Returns:
this Control instance

setIcon

public final Control setIcon(Icon icon)
Parameters:
icon - the icon to associate with this Control
Returns:
this Control instance

getIcon

public final Icon getIcon()
Returns:
the icon