StocksMonitor 1.5.0

hirondelle.stocks.file
Class FileNewAction

Object
  extended by AbstractAction
      extended by FileNewAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public final class FileNewAction
extends AbstractAction

Create a new Portfolio which has a unique name, is placed in storage, and is displayed to the user as the (empty) CurrentPortfolio, and which does not need a save.

If the CurrentPortfolio needs to be saved, then the appropriate Save or Save As action is called.

This action is always enabled.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class AbstractAction
changeSupport, enabled
 
Fields inherited from interface Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
FileNewAction(CurrentPortfolio aCurrentPortfolio, JFrame aFrame, EditSaver aEditSaver)
          Constructor.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Present dialog for the input of a name for the new Portfolio.
 
Methods inherited from class AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileNewAction

public FileNewAction(CurrentPortfolio aCurrentPortfolio,
                     JFrame aFrame,
                     EditSaver aEditSaver)
Constructor.

Parameters:
aCurrentPortfolio - is updated by this action
aFrame - parent window
aEditSaver - allows the user to save any unsaved edits of the old CurrentPortfolio
Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)
Present dialog for the input of a name for the new Portfolio.

The supplied name must have a non-zero trimmed length, and must not be the the same name as any currently stored Portfolio. If the name entered by the user is invalid, then when OK is selected an info box informs the users of the problem, and they are asked to enter another name.

If the CurrentPortfolio being replaced by this action has any unsaved edits, then allow the user the option of saving such edits.


StocksMonitor 1.5.0

Copyright Hirondelle Systems - License - Generated 2008Jul12.10.53