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:
ActionListener,Serializable,Cloneable,EventListener,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:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class jmri.jmrit.beantable.AbstractTableAction
AbstractTableAction.TableItem<E extends NamedBean> -
Field Summary
FieldsModifier and TypeFieldDescription(package private) JTextField(package private) JCheckBoxprotected Eprotected AbstractLogixNGEditor<E>(package private) String(package private) PickFrame(package private) boolean(package private) JLabel(package private) JTextField(package private) JLabel(package private) JmriJFrame(package private) int(package private) JButton(package private) DeleteBean<E>(package private) StringFields inherited from class jmri.jmrit.beantable.AbstractTableAction
f, includeAddButton, mFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
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 Summary
ConstructorsConstructorDescriptionCreate a AbstractLogixNGTableAction instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRespond to the Add button in bean table Creates and/or initialize the Add bean pane.(package private) voidEnable/disable fields for data entry when user selects to have system name automatically generated.protected boolean(package private) voidbrowserPressed(String sName) Respond to the Browse button pressed in bean table.(package private) voidRespond to the Cancel button in Add bean window.(package private) booleancheckFlags(String sName) Check if another bean editing session is currently open or no system name is provided.(package private) booleanCheck validity of various LogixNG system names.(package private) booleancheckLogixNGUserName(String uName) Check and warn if a string is already in use as the user name of a LogixNG.protected void(package private) voidcopyPressed(String sName) Respond to the Copy bean button in Add bean window.protected abstract EcreateBean(String userName) protected abstract EcreateBean(String systemName, String userName) protected voidCreate the JTable DataModel, along with the changes (overrides of BeanTableDataModel) for the specific case of a LogixNG table.(package private) voidRespond to the Create bean button in Add bean window.protected abstract voiddeleteBean(E bean) (package private) voiddeletePressed(String sName) Respond to the Delete combo selection bean window delete request.(package private) voideditPressed(String sName) Respond to the Edit button pressed in LogixNG table.protected abstract voidenableAll(boolean enable) protected void(package private) voidexecutePressed(String sName) Respond to the Execute combo selection bean window execute request.protected abstract Stringprotected abstract StringgetBeanText(E bean, Base.PrintTreeSettings printTreeSettings) protected abstract Stringprotected Stringprotected abstract Stringprotected abstract AbstractLogixNGEditor<E>getEditor(BeanTableDataModel<E> m, String sName) protected abstract voidgetListenerRefsIncludingChildren(E t, List<String> list) Get the Bean Manager in use by the TableAction.(package private) voidhandleCreateException(String sysName) protected abstract booleanhasChildren(E t) protected StringSpecify the JavaHelp target for this specific panel.protected booleanprotected booleanprotected abstract booleanprotected booleanprotected abstract JPanelmakeAddFrame(String titleId, String startMessageId) protected abstract voidsetEnabled(E bean, boolean enable) voidInsert 2 table specific menus.protected voidsetTitle()Set title of NamedBean table.Methods inherited from class jmri.jmrit.beantable.AbstractTableAction
actionPerformed, addBottomButtons, addToFrame, addToFrame, addToPanel, columnsVisibleUpdated, configureManagerComboBox, configureTable, displayHwError, dispose, getClassDescription, getDataModel, getFrame, getPanel, getTableDataModel, includeAddButton, nextName, print, removePrefixBoxListener, setFrame, setManager, setMessagePreferencesDetailsMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
deleteBean
DeleteBean<E extends NamedBean> deleteBean -
_editor
-
_showReminder
boolean _showReminder -
_pickTables
-
_curNamedBean
-
conditionalRowNumber
-
addLogixNGFrame
-
_systemName
-
_addUserName
-
_autoSystemName
-
_sysNameLabel
-
_userNameLabel
-
systemNameAuto
-
create
-
_logixNGSysName
-
-
Constructor Details
-
AbstractLogixNGTableAction
Create a AbstractLogixNGTableAction instance.- Parameters:
s- the Action title, not the title of the resulting frame. Perhaps this should be changed?
-
-
Method Details
-
getEditor
-
isEditSupported
-
getManager
Description copied from class:AbstractTableActionGet the Bean Manager in use by the TableAction.- Overrides:
getManagerin classAbstractTableAction<E extends NamedBean>- Returns:
- Bean Manager, could be Proxy or normal Manager, may be null.
-
enableAll
-
setEnabled
-
isEnabled
-
createBean
-
createBean
-
deleteBean
-
browseMonoSpace
-
getBeanText
-
getBrowserTitle
-
getAddTitleKey
-
getCreateButtonHintKey
-
getListenerRefsIncludingChildren
-
hasChildren
-
createModel
Create the JTable DataModel, along with the changes (overrides of BeanTableDataModel) for the specific case of a LogixNG table.- Specified by:
createModelin classAbstractTableAction<E extends NamedBean>
-
setTitle
Set title of NamedBean table.- Specified by:
setTitlein classAbstractTableAction<E extends NamedBean>
-
setMenuBar
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:
setMenuBarin classAbstractTableAction<E extends NamedBean>- Parameters:
f- the JFrame of this table
-
helpTarget
Description copied from class:AbstractTableActionSpecify the JavaHelp target for this specific panel.- Overrides:
helpTargetin classAbstractTableAction<E extends NamedBean>- Returns:
- a fixed default string "index" pointing to to highest level in JMRI Help
-
addPressed
Respond to the Add button in bean table Creates and/or initialize the Add bean pane.- Specified by:
addPressedin classAbstractTableAction<E extends NamedBean>- Parameters:
e- The event heard
-
makeAddFrame
-
autoSystemName
void autoSystemName()Enable/disable fields for data entry when user selects to have system name automatically generated. -
cancelAddPressed
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
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
-
copyBean
-
isCopyBeanSupported
-
isExecuteSupported
-
execute
-
checkLogixNGUserName
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
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
Respond to the Create bean button in Add bean window.- Parameters:
e- The event heard
-
handleCreateException
-
editPressed
Respond to the Edit button pressed in LogixNG table.- Parameters:
sName- system name of LogixNG to be edited
-
deletePressed
Respond to the Delete combo selection bean window delete request.- Parameters:
sName- system name of bean to be deleted
-
executePressed
Respond to the Execute combo selection bean window execute request.- Parameters:
sName- system name of bean to be deleted
-
getClassName
- Specified by:
getClassNamein classAbstractTableAction<E extends NamedBean>
-
browserPressed
Respond to the Browse button pressed in bean table.- Parameters:
sName- The selected bean system name
-