public final class FileNewAction extends AbstractAction
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.
changeSupport, enabled
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 and Description |
---|
FileNewAction(CurrentPortfolio aCurrentPortfolio,
JFrame aFrame,
EditSaver aEditSaver)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent event)
Present dialog for the input of a name for the new Portfolio.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public FileNewAction(CurrentPortfolio aCurrentPortfolio, JFrame aFrame, EditSaver aEditSaver)
aCurrentPortfolio
- is updated by this actionaFrame
- parent windowaEditSaver
- allows the user to save any unsaved edits of the old
CurrentPortfoliopublic void actionPerformed(ActionEvent event)
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.
Copyright Hirondelle Systems - License - Generated 2013Sep20.10.58