csheets.ui.ext
Class ComponentAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by csheets.ui.ctrl.BaseAction
          extended by csheets.ui.ctrl.FocusOwnerAction
              extended by csheets.ui.ext.ComponentAction
All Implemented Interfaces:
ActionListener, PropertyChangeListener, Serializable, Cloneable, EventListener, Action

public class ComponentAction
extends FocusOwnerAction

An action for enabling and disabling UI extension components.

Author:
Einar Pehrson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class csheets.ui.ctrl.FocusOwnerAction
focusOwner
 
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
ComponentAction(UIExtension extension, JComponent component, String componentKey)
          Creates a new component action.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Toggles the visiblity of the component.
protected  String getName()
          Returns the action's name.
 
Methods inherited from class csheets.ui.ctrl.FocusOwnerAction
propertyChange
 
Methods inherited from class csheets.ui.ctrl.BaseAction
defineProperties, requiresFile, requiresModification, showErrorDialog
 
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

ComponentAction

public ComponentAction(UIExtension extension,
                       JComponent component,
                       String componentKey)
Creates a new component action.

Parameters:
extension - the extension to control
component - the component to control
componentKey - the property key of the component
Method Detail

getName

protected String getName()
Description copied from class: BaseAction
Returns the action's name.

Specified by:
getName in class BaseAction
Returns:
the action's name, which is used as short description and action command

actionPerformed

public void actionPerformed(ActionEvent event)
Toggles the visiblity of the component.

Parameters:
event - the event that was fired