Package jmri.jmrit.beantable
Class BlockTableAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.jmrit.beantable.AbstractTableAction<Block>
-
- jmri.jmrit.beantable.BlockTableAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
public class BlockTableAction extends AbstractTableAction<Block>
Swing action to create and register a BlockTable GUI.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BlockTableAction.RestoreRule
Rules for restoring block values *-
Nested classes/interfaces inherited from class jmri.jmrit.beantable.AbstractTableAction
AbstractTableAction.TableItem<E extends NamedBean>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.JCheckBox
_autoSystemNameCheckBox
(package private) BlockTableAction.RestoreRule
_restoreRule
(package private) JmriJFrame
addFrame
(package private) javax.swing.JCheckBox
addRangeCheckBox
static java.lang.String
BLOCK_METRIC_PREF
(package private) javax.swing.JSpinner
numberToAddSpinner
(package private) javax.swing.SpinnerNumberModel
numberToAddSpinnerNumberModel
(package private) javax.swing.JLabel
statusBar
(package private) javax.swing.JTextField
sysName
(package private) javax.swing.JLabel
sysNameLabel
(package private) java.lang.String
systemNameAuto
(package private) javax.swing.JTextField
userName
(package private) javax.swing.JLabel
userNameLabel
-
Fields inherited from class jmri.jmrit.beantable.AbstractTableAction
f, includeAddButton, m
-
-
Constructor Summary
Constructors Constructor Description BlockTableAction()
BlockTableAction(java.lang.String actionName)
Create an action with a specific title.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addPressed(java.awt.event.ActionEvent e)
void
addToFrame(BeanTableFrame<Block> f)
Add the radioButtons (only 1 may be selected).(package private) void
cancelPressed(java.awt.event.ActionEvent e)
protected void
createModel()
Create the JTable DataModel, along with the changes for the specific case of Block objects.(package private) void
deletePaths(JmriJFrame f)
java.lang.String
getClassDescription()
protected java.lang.String
getClassName()
protected Manager<Block>
getManager()
Get the Bean Manager in use by the TableAction.static BlockTableAction.RestoreRule
getRestoreRule()
Retrieve the restore rule selection from user preferences(package private) void
handleCreateException(java.lang.String sysName)
protected java.lang.String
helpTarget()
Specify the JavaHelp target for this specific panel.(package private) void
okPressed(java.awt.event.ActionEvent e)
Respond to Create new item pressed on Add Block pane.void
setMenuBar(BeanTableFrame<Block> f)
Insert 2 table specific menus.(package private) void
setRestoreRule(BlockTableAction.RestoreRule newRule)
Save the restore rule selection.protected void
setTitle()
Include the correct title.-
Methods inherited from class jmri.jmrit.beantable.AbstractTableAction
actionPerformed, addBottomButtons, addToFrame, addToPanel, columnsVisibleUpdated, configureManagerComboBox, configureTable, displayHwError, dispose, getFrame, getPanel, getTableDataModel, includeAddButton, nextName, print, removePrefixBoxListener, setFrame, setManager, setMessagePreferencesDetails
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
BLOCK_METRIC_PREF
public static final java.lang.String BLOCK_METRIC_PREF
-
addFrame
JmriJFrame addFrame
-
sysName
javax.swing.JTextField sysName
-
userName
javax.swing.JTextField userName
-
sysNameLabel
javax.swing.JLabel sysNameLabel
-
userNameLabel
javax.swing.JLabel userNameLabel
-
numberToAddSpinnerNumberModel
javax.swing.SpinnerNumberModel numberToAddSpinnerNumberModel
-
numberToAddSpinner
javax.swing.JSpinner numberToAddSpinner
-
addRangeCheckBox
javax.swing.JCheckBox addRangeCheckBox
-
_autoSystemNameCheckBox
javax.swing.JCheckBox _autoSystemNameCheckBox
-
statusBar
javax.swing.JLabel statusBar
-
_restoreRule
BlockTableAction.RestoreRule _restoreRule
-
systemNameAuto
java.lang.String systemNameAuto
-
-
Constructor Detail
-
BlockTableAction
public BlockTableAction(java.lang.String actionName)
Create an action with a specific title.Note that the argument is the Action title, not the title of the resulting frame. Perhaps this should be changed?
- Parameters:
actionName
- the Action title
-
BlockTableAction
public BlockTableAction()
-
-
Method Detail
-
createModel
protected void createModel()
Create the JTable DataModel, along with the changes for the specific case of Block objects.- Specified by:
createModel
in classAbstractTableAction<Block>
-
getManager
@Nonnull protected Manager<Block> getManager()
Description copied from class:AbstractTableAction
Get the Bean Manager in use by the TableAction.- Overrides:
getManager
in classAbstractTableAction<Block>
- Returns:
- Bean Manager, could be Proxy or normal Manager, may be null.
-
setTitle
protected void setTitle()
Description copied from class:AbstractTableAction
Include the correct title.- Specified by:
setTitle
in classAbstractTableAction<Block>
-
addToFrame
public void addToFrame(BeanTableFrame<Block> f)
Add the radioButtons (only 1 may be selected).- Overrides:
addToFrame
in classAbstractTableAction<Block>
- Parameters:
f
- the Frame to add to
-
setMenuBar
public void setMenuBar(BeanTableFrame<Block> f)
Insert 2 table specific menus.Account for the Window and Help menus, which are already added to the menu bar as part of the creation of the JFrame, by adding the menus 2 places earlier unless the table is part of the ListedTableFrame, that adds the Help menu later on.
- Overrides:
setMenuBar
in classAbstractTableAction<Block>
- Parameters:
f
- the JFrame of this table
-
setRestoreRule
void setRestoreRule(BlockTableAction.RestoreRule newRule)
Save the restore rule selection. Called by menu item change events.- Parameters:
newRule
- The RestoreRule enum constant
-
getRestoreRule
public static BlockTableAction.RestoreRule getRestoreRule()
Retrieve the restore rule selection from user preferences- Returns:
- restoreRule
-
helpTarget
protected java.lang.String helpTarget()
Description copied from class:AbstractTableAction
Specify the JavaHelp target for this specific panel.- Overrides:
helpTarget
in classAbstractTableAction<Block>
- Returns:
- a fixed default string "index" pointing to to highest level in JMRI Help
-
addPressed
protected void addPressed(java.awt.event.ActionEvent e)
- Specified by:
addPressed
in classAbstractTableAction<Block>
-
cancelPressed
void cancelPressed(java.awt.event.ActionEvent e)
-
okPressed
void okPressed(java.awt.event.ActionEvent e)
Respond to Create new item pressed on Add Block pane.- Parameters:
e
- the click event
-
handleCreateException
void handleCreateException(java.lang.String sysName)
-
deletePaths
void deletePaths(JmriJFrame f)
-
getClassDescription
public java.lang.String getClassDescription()
- Overrides:
getClassDescription
in classAbstractTableAction<Block>
-
getClassName
protected java.lang.String getClassName()
- Specified by:
getClassName
in classAbstractTableAction<Block>
-
-