csheets.ui.ctrl
Class SaveAsAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by csheets.ui.ctrl.BaseAction
          extended by csheets.ui.ctrl.SaveAsAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
SaveAction

public class SaveAsAction
extends BaseAction

An action for saving a spreadsheet to a user-supplied file.

Author:
Einar Pehrson
See Also:
Serialized Form

Field Summary
protected  CleanSheets app
          The CleanSheets application
protected  FileChooser chooser
          The file chooser to use when prompting the user for the file to save
protected  UIController uiController
          The user interface controller
 
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
SaveAsAction(CleanSheets app, UIController uiController, FileChooser chooser)
          Creates a new save as action.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
protected  void defineProperties()
          Defines the action's properties.
protected  String getName()
          Returns the action's name.
protected  boolean requiresFile()
          Returns whether the action requires the active workbook to be stored in a file in order to be enabled.
 void setEnabled(boolean enabled)
           
 
Methods inherited from class csheets.ui.ctrl.BaseAction
requiresModification, showErrorDialog
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

app

protected CleanSheets app
The CleanSheets application


uiController

protected UIController uiController
The user interface controller


chooser

protected FileChooser chooser
The file chooser to use when prompting the user for the file to save

Constructor Detail

SaveAsAction

public SaveAsAction(CleanSheets app,
                    UIController uiController,
                    FileChooser chooser)
Creates a new save as action.

Parameters:
app - the CleanSheets application
uiController - the user interface controller
chooser - the file chooser to use when prompting the user for the file to save
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

actionPerformed

public void actionPerformed(ActionEvent e)

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface Action
Overrides:
setEnabled in class AbstractAction

requiresFile

protected boolean requiresFile()
Description copied from class: BaseAction
Returns whether the action requires the active workbook to be stored in a file in order to be enabled. By default, the method returns false.

Overrides:
requiresFile in class BaseAction
Returns:
whether the action should be enabled