Package jmri.jmrit.beantable
Class AbstractLogixNGTableAction<E extends NamedBean>
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.jmrit.beantable.AbstractTableAction<E>
-
- jmri.jmrit.beantable.AbstractLogixNGTableAction<E>
-
- Type Parameters:
E
- the type of NamedBean supported by this model
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
- Direct Known Subclasses:
LogixNGGlobalVariableTableAction
,LogixNGModuleTableAction
,LogixNGTableAction
,LogixNGTableTableAction
public abstract class AbstractLogixNGTableAction<E extends NamedBean> extends AbstractTableAction<E>
Swing action to create and register a LogixNG Table.Also contains the panes to create, edit, and delete a LogixNG.
Most of the text used in this GUI is in BeanTableBundle.properties, accessed via Bundle.getMessage().
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractLogixNGTableAction.TableModel
-
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.JTextField
_addUserName
(package private) javax.swing.JCheckBox
_autoSystemName
protected E
_curNamedBean
protected AbstractLogixNGEditor<E>
_editor
(package private) java.lang.String
_logixNGSysName
(package private) PickFrame
_pickTables
(package private) boolean
_showReminder
(package private) javax.swing.JLabel
_sysNameLabel
(package private) javax.swing.JTextField
_systemName
(package private) javax.swing.JLabel
_userNameLabel
(package private) JmriJFrame
addLogixNGFrame
(package private) int
conditionalRowNumber
(package private) javax.swing.JButton
create
(package private) DeleteBean<E>
deleteBean
(package private) java.lang.String
systemNameAuto
-
Fields inherited from class jmri.jmrit.beantable.AbstractTableAction
f, includeAddButton, m
-
-
Constructor Summary
Constructors Constructor Description AbstractLogixNGTableAction(java.lang.String s)
Create a AbstractLogixNGTableAction instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addPressed(java.awt.event.ActionEvent e)
Respond to the Add button in bean table Creates and/or initialize the Add bean pane.(package private) void
autoSystemName()
Enable/disable fields for data entry when user selects to have system name automatically generated.protected boolean
browseMonoSpace()
(package private) void
browserPressed(java.lang.String sName)
Respond to the Browse button pressed in bean table.(package private) void
cancelAddPressed(java.awt.event.ActionEvent e)
Respond to the Cancel button in Add bean window.(package private) boolean
checkFlags(java.lang.String sName)
Check if another bean editing session is currently open or no system name is provided.(package private) boolean
checkLogixNGSysName()
Check validity of various LogixNG system names.(package private) boolean
checkLogixNGUserName(java.lang.String uName)
Check and warn if a string is already in use as the user name of a LogixNG.protected void
copyBean(E sourceBean, E targetBean)
(package private) void
copyPressed(java.lang.String sName)
Respond to the Copy bean button in Add bean window.protected abstract E
createBean(java.lang.String userName)
protected abstract E
createBean(java.lang.String systemName, java.lang.String userName)
protected void
createModel()
Create the JTable DataModel, along with the changes (overrides of BeanTableDataModel) for the specific case of a LogixNG table.(package private) void
createPressed(java.awt.event.ActionEvent e)
Respond to the Create bean button in Add bean window.protected abstract void
deleteBean(E bean)
(package private) void
deletePressed(java.lang.String sName)
Respond to the Delete combo selection bean window delete request.(package private) void
editPressed(java.lang.String sName)
Respond to the Edit button pressed in LogixNG table.protected abstract void
enableAll(boolean enable)
protected void
execute(E bean)
(package private) void
executePressed(java.lang.String sName)
Respond to the Execute combo selection bean window execute request.protected abstract java.lang.String
getAddTitleKey()
protected abstract java.lang.String
getBeanText(E bean, Base.PrintTreeSettings printTreeSettings)
protected abstract java.lang.String
getBrowserTitle()
java.lang.String
getClassDescription()
protected java.lang.String
getClassName()
protected abstract java.lang.String
getCreateButtonHintKey()
protected abstract AbstractLogixNGEditor<E>
getEditor(BeanTableDataModel<E> m, java.lang.String sName)
protected abstract void
getListenerRefsIncludingChildren(E t, java.util.List<java.lang.String> list)
protected abstract Manager<E>
getManager()
Get the Bean Manager in use by the TableAction.(package private) void
handleCreateException(java.lang.String sysName)
protected abstract boolean
hasChildren(E t)
protected java.lang.String
helpTarget()
Specify the JavaHelp target for this specific panel.protected boolean
isCopyBeanSupported()
protected boolean
isEditSupported()
protected abstract boolean
isEnabled(E bean)
protected boolean
isExecuteSupported()
protected abstract javax.swing.JPanel
makeAddFrame(java.lang.String titleId, java.lang.String startMessageId)
protected abstract void
setEnabled(E bean, boolean enable)
void
setMenuBar(BeanTableFrame<E> f)
Insert 2 table specific menus.void
setMessagePreferencesDetails()
protected void
setTitle()
Set title of NamedBean table.(package private) void
showSaveReminder()
Display reminder to save.-
Methods inherited from class jmri.jmrit.beantable.AbstractTableAction
actionPerformed, addBottomButtons, addToFrame, addToFrame, addToPanel, columnsVisibleUpdated, configureManagerComboBox, configureTable, displayHwError, dispose, getFrame, getPanel, getTableDataModel, includeAddButton, nextName, print, removePrefixBoxListener, setFrame, setManager
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
deleteBean
DeleteBean<E extends NamedBean> deleteBean
-
_editor
protected AbstractLogixNGEditor<E extends NamedBean> _editor
-
_showReminder
boolean _showReminder
-
_pickTables
PickFrame _pickTables
-
_curNamedBean
protected E extends NamedBean _curNamedBean
-
conditionalRowNumber
int conditionalRowNumber
-
addLogixNGFrame
JmriJFrame addLogixNGFrame
-
_systemName
javax.swing.JTextField _systemName
-
_addUserName
javax.swing.JTextField _addUserName
-
_autoSystemName
javax.swing.JCheckBox _autoSystemName
-
_sysNameLabel
javax.swing.JLabel _sysNameLabel
-
_userNameLabel
javax.swing.JLabel _userNameLabel
-
systemNameAuto
java.lang.String systemNameAuto
-
create
javax.swing.JButton create
-
_logixNGSysName
java.lang.String _logixNGSysName
-
-
Constructor Detail
-
AbstractLogixNGTableAction
public AbstractLogixNGTableAction(java.lang.String s)
Create a AbstractLogixNGTableAction instance.- Parameters:
s
- the Action title, not the title of the resulting frame. Perhaps this should be changed?
-
-
Method Detail
-
getEditor
protected abstract AbstractLogixNGEditor<E> getEditor(BeanTableDataModel<E> m, java.lang.String sName)
-
isEditSupported
protected boolean isEditSupported()
-
getManager
@Nonnull protected abstract Manager<E> getManager()
Description copied from class:AbstractTableAction
Get the Bean Manager in use by the TableAction.- Overrides:
getManager
in classAbstractTableAction<E extends NamedBean>
- Returns:
- Bean Manager, could be Proxy or normal Manager, may be null.
-
enableAll
protected abstract void enableAll(boolean enable)
-
setEnabled
protected abstract void setEnabled(E bean, boolean enable)
-
createBean
protected abstract E createBean(java.lang.String userName)
-
createBean
protected abstract E createBean(java.lang.String systemName, java.lang.String userName)
-
deleteBean
protected abstract void deleteBean(E bean)
-
browseMonoSpace
protected boolean browseMonoSpace()
-
getBeanText
protected abstract java.lang.String getBeanText(E bean, Base.PrintTreeSettings printTreeSettings)
-
getBrowserTitle
protected abstract java.lang.String getBrowserTitle()
-
getAddTitleKey
protected abstract java.lang.String getAddTitleKey()
-
getCreateButtonHintKey
protected abstract java.lang.String getCreateButtonHintKey()
-
getListenerRefsIncludingChildren
protected abstract void getListenerRefsIncludingChildren(E t, java.util.List<java.lang.String> list)
-
hasChildren
protected abstract boolean hasChildren(E t)
-
createModel
protected void createModel()
Create the JTable DataModel, along with the changes (overrides of BeanTableDataModel) for the specific case of a LogixNG table.- Specified by:
createModel
in classAbstractTableAction<E extends NamedBean>
-
setTitle
protected void setTitle()
Set title of NamedBean table.- Specified by:
setTitle
in classAbstractTableAction<E extends NamedBean>
-
setMenuBar
public void setMenuBar(BeanTableFrame<E> f)
Insert 2 table specific menus.Accounts 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 new menus 2 places earlier unless the table is part of the ListedTableFrame, which adds the Help menu later on.
- Overrides:
setMenuBar
in classAbstractTableAction<E extends NamedBean>
- Parameters:
f
- the JFrame of this table
-
helpTarget
protected java.lang.String helpTarget()
Description copied from class:AbstractTableAction
Specify the JavaHelp target for this specific panel.- Overrides:
helpTarget
in classAbstractTableAction<E extends NamedBean>
- Returns:
- a fixed default string "index" pointing to to highest level in JMRI Help
-
addPressed
protected void addPressed(java.awt.event.ActionEvent e)
Respond to the Add button in bean table Creates and/or initialize the Add bean pane.- Specified by:
addPressed
in classAbstractTableAction<E extends NamedBean>
- Parameters:
e
- The event heard
-
makeAddFrame
protected abstract javax.swing.JPanel makeAddFrame(java.lang.String titleId, java.lang.String startMessageId)
-
autoSystemName
void autoSystemName()
Enable/disable fields for data entry when user selects to have system name automatically generated.
-
cancelAddPressed
void cancelAddPressed(java.awt.event.ActionEvent e)
Respond to the Cancel button in Add bean window.Note: Also get there if the user closes the Add bean window.
- Parameters:
e
- The event heard
-
copyPressed
void copyPressed(java.lang.String sName)
Respond to the Copy bean button in Add bean window.Provides a pane to set new properties of the copy.
- Parameters:
sName
- system name of bean to be copied
-
isCopyBeanSupported
protected boolean isCopyBeanSupported()
-
isExecuteSupported
protected boolean isExecuteSupported()
-
checkLogixNGUserName
boolean checkLogixNGUserName(java.lang.String uName)
Check and warn if a string is already in use as the user name of a LogixNG.- Parameters:
uName
- the suggested name- Returns:
- true if not in use
-
checkLogixNGSysName
boolean checkLogixNGSysName()
Check validity of various LogixNG system names.Fixes name if it doesn't start with the appropriate prefix or the $ for alpha suffixes
- Returns:
- false if the name fails the NameValidity check
-
checkFlags
boolean checkFlags(java.lang.String sName)
Check if another bean editing session is currently open or no system name is provided.- Parameters:
sName
- system name of bean to be copied- Returns:
- true if a new session may be started
-
createPressed
void createPressed(java.awt.event.ActionEvent e)
Respond to the Create bean button in Add bean window.- Parameters:
e
- The event heard
-
handleCreateException
void handleCreateException(java.lang.String sysName)
-
editPressed
void editPressed(java.lang.String sName)
Respond to the Edit button pressed in LogixNG table.- Parameters:
sName
- system name of LogixNG to be edited
-
showSaveReminder
void showSaveReminder()
Display reminder to save.
-
setMessagePreferencesDetails
public void setMessagePreferencesDetails()
- Overrides:
setMessagePreferencesDetails
in classAbstractTableAction<E extends NamedBean>
-
deletePressed
void deletePressed(java.lang.String sName)
Respond to the Delete combo selection bean window delete request.- Parameters:
sName
- system name of bean to be deleted
-
executePressed
void executePressed(java.lang.String sName)
Respond to the Execute combo selection bean window execute request.- Parameters:
sName
- system name of bean to be deleted
-
getClassDescription
public java.lang.String getClassDescription()
- Overrides:
getClassDescription
in classAbstractTableAction<E extends NamedBean>
-
getClassName
protected java.lang.String getClassName()
- Specified by:
getClassName
in classAbstractTableAction<E extends NamedBean>
-
browserPressed
void browserPressed(java.lang.String sName)
Respond to the Browse button pressed in bean table.- Parameters:
sName
- The selected bean system name
-
-