public final class EditPortfolioAction extends AbstractAction
Stock
objects in the CurrentPortfolio
. (See StockEditor
as well.)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 |
---|
EditPortfolioAction(CurrentPortfolio aCurrentPortfolio,
JFrame aFrame)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent aEvent)
Display a modal dialog, centered on the main window, to allow the user to
edit their portfolio of stocks.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public EditPortfolioAction(CurrentPortfolio aCurrentPortfolio, JFrame aFrame)
aCurrentPortfolio
- contains the stocks in which the user has an interest.aFrame
- parent frame to which this editor is attached (the main window).public void actionPerformed(ActionEvent aEvent)
If the user selects OK, save any edits and update the display of the main window - otherwise, discard all edits.
The current stocks are presented in a table, along with Add-Change-Delete buttons. The Add button is always enabled, while the Change and Delete buttons are enabled only if a table row is selected.
Add and Change operations will verify input of each field : when focus leaves a field, any invalid input will cause a short message to be placed in the field. Selecting OK while any item is still invalid will cause a message to be displayed, asking for correction before proceeding. The only difference between Add and Change is that the Change operation will pre-populate data entry areas.
Copyright Hirondelle Systems - License - Generated 2013Sep20.10.58