csheets.ext.style.ui
Class FormatAction

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

public class FormatAction
extends FocusOwnerAction
implements SelectionListener

A format changing operation.

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
FormatAction(UIController uiController)
          Creates a new format action.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Lets the user select a format from a chooser.
protected  void defineProperties()
          Defines the action's properties.
protected  String getName()
          Returns the action's name.
 void selectionChanged(SelectionEvent event)
          Updates the state of the action when a new cell is selected.
 
Methods inherited from class csheets.ui.ctrl.FocusOwnerAction
propertyChange
 
Methods inherited from class csheets.ui.ctrl.BaseAction
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

FormatAction

public FormatAction(UIController uiController)
Creates a new format action.

Parameters:
uiController - the user interface controller
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

defineProperties

protected void defineProperties()
Description copied from class: BaseAction
Defines the action's properties.

Overrides:
defineProperties in class BaseAction

selectionChanged

public void selectionChanged(SelectionEvent event)
Updates the state of the action when a new cell is selected.

Specified by:
selectionChanged in interface SelectionListener
Parameters:
event - the selection event that was fired

actionPerformed

public void actionPerformed(ActionEvent event)
Lets the user select a format from a chooser. Then applies the format to the selected cells in the focus owner table.

Specified by:
actionPerformed in interface ActionListener
Parameters:
event - the event that was fired