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 classBlockTableAction.RestoreRuleRules 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 static java.lang.StringBLOCK_METRIC_PREF-
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 voidaddPressed(java.awt.event.ActionEvent e)voidaddToFrame(BeanTableFrame<Block> f)Add the radioButtons (only 1 may be selected).(package private) voidcancelPressed(java.awt.event.ActionEvent e)protected voidcreateModel()Create the JTable DataModel, along with the changes for the specific case of Block objects.(package private) voiddeletePaths(JmriJFrame f)java.lang.StringgetClassDescription()protected java.lang.StringgetClassName()protected Manager<Block>getManager()Get the Bean Manager in use by the TableAction.static BlockTableAction.RestoreRulegetRestoreRule()Retrieve the restore rule selection from user preferences(package private) voidhandleCreateException(java.lang.String sysName)protected java.lang.StringhelpTarget()Specify the JavaHelp target for this specific panel.(package private) voidokPressed(java.awt.event.ActionEvent e)Respond to Create new item pressed on Add Block pane.voidsetMenuBar(BeanTableFrame<Block> f)Insert 2 table specific menus.(package private) voidsetRestoreRule(BlockTableAction.RestoreRule newRule)Save the restore rule selection.protected voidsetTitle()Include the correct title.-
Methods inherited from class jmri.jmrit.beantable.AbstractTableAction
actionPerformed, addBottomButtons, addToFrame, addToPanel, columnsVisibleUpdated, configureManagerComboBox, configureTable, displayHwError, dispose, getDataModel, 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
-
-
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:
createModelin classAbstractTableAction<Block>
-
getManager
@Nonnull protected Manager<Block> getManager()
Description copied from class:AbstractTableActionGet the Bean Manager in use by the TableAction.- Overrides:
getManagerin classAbstractTableAction<Block>- Returns:
- Bean Manager, could be Proxy or normal Manager, may be null.
-
setTitle
protected void setTitle()
Description copied from class:AbstractTableActionInclude the correct title.- Specified by:
setTitlein classAbstractTableAction<Block>
-
addToFrame
public void addToFrame(BeanTableFrame<Block> f)
Add the radioButtons (only 1 may be selected).- Overrides:
addToFramein 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:
setMenuBarin 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:AbstractTableActionSpecify the JavaHelp target for this specific panel.- Overrides:
helpTargetin 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:
addPressedin 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:
getClassDescriptionin classAbstractTableAction<Block>
-
getClassName
protected java.lang.String getClassName()
- Specified by:
getClassNamein classAbstractTableAction<Block>
-
-