Package jmri.jmrit.beantable
Class AbstractLogixNGTableAction.TableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.beantable.BeanTableDataModel<E>
-
- jmri.jmrit.beantable.AbstractLogixNGTableAction.TableModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
- Direct Known Subclasses:
LogixNGGlobalVariableTableAction.TableModel
,LogixNGTableAction.TableModel
- Enclosing class:
- AbstractLogixNGTableAction<E extends NamedBean>
protected class AbstractLogixNGTableAction.TableModel extends BeanTableDataModel<E>
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrit.beantable.BeanTableDataModel
BeanTableDataModel.BeanTableTooltipHeaderRenderer, BeanTableDataModel.DateRenderer, BeanTableDataModel.DeleteBeanWorker, BeanTableDataModel.HeaderActionListener, BeanTableDataModel.PopupListener, BeanTableDataModel.TableHeaderListener
-
-
Field Summary
Fields Modifier and Type Field Description static int
EDITCOL
static int
ENABLECOL
protected java.lang.String
enabledString
-
Fields inherited from class jmri.jmrit.beantable.BeanTableDataModel
COMMENTCOL, DELETECOL, NUMCOLUMN, SYSNAMECOL, sysNameList, USERNAMECOL, VALUECOL
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TableModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clickOn(NamedBean t)
Process a click on The value cell.protected void
configDeleteColumn(javax.swing.JTable table)
Replace delete button with comboBox to edit/delete/copy/select NamedBean.void
configureTable(javax.swing.JTable table)
Configure a table to have our standard rows and columns.protected void
doDelete(E bean)
Delete the bean after all the checking has been done.protected java.lang.String
getBeanType()
Get String of the Single Bean Type.E
getBySystemName(java.lang.String name)
E
getByUserName(java.lang.String name)
java.lang.Class<?>
getColumnClass(int col)
java.lang.String
getColumnName(int col)
Manager<E>
getManager()
Get the Table Model Bean Manager.protected java.lang.String
getMasterClassName()
int
getPreferredWidth(int col)
java.lang.String
getValue(java.lang.String s)
Get the current Bean state value in human readable form.java.lang.Object
getValueAt(int row, int col)
SYSNAMECOL returns the actual Bean, NOT the System Name.boolean
isCellEditable(int row, int col)
protected boolean
matchPropertyName(java.beans.PropertyChangeEvent e)
Is this property event announcing a change this table should display?void
setValueAt(java.lang.Object value, int row, int col)
-
Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, allowBlockNameChange, configureButton, configureJTable, configValueColumn, copyName, deleteBean, dispose, editComment, formatToolTip, getCellToolTip, getColumnCount, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPropertyColumnCount, getPropertyColumnDescriptor, getRowCount, isClearUserNameAllowed, makeJTable, moveBean, persistTable, printColumns, printTable, propertyChange, removeName, renameBean, setColumnIdentities, setColumnToHoldButton, setDisplayDeleteMsg, setFilter, setManager, setPropertyColumnsVisible, showPopup, showTableHeaderPopup, stopPersistingTable, updateNameList
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Field Detail
-
ENABLECOL
public static final int ENABLECOL
- See Also:
- Constant Field Values
-
EDITCOL
public static final int EDITCOL
- See Also:
- Constant Field Values
-
enabledString
protected java.lang.String enabledString
-
-
Constructor Detail
-
TableModel
protected TableModel()
-
-
Method Detail
-
getColumnName
public java.lang.String getColumnName(int col)
Description copied from class:BeanTableDataModel
- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classBeanTableDataModel<E extends NamedBean>
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
Description copied from class:BeanTableDataModel
- Specified by:
getColumnClass
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnClass
in classBeanTableDataModel<E extends NamedBean>
-
getPreferredWidth
public int getPreferredWidth(int col)
- Overrides:
getPreferredWidth
in classBeanTableDataModel<E extends NamedBean>
-
isCellEditable
public boolean isCellEditable(int row, int col)
Description copied from class:BeanTableDataModel
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in classBeanTableDataModel<E extends NamedBean>
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
Description copied from class:BeanTableDataModel
SYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
getValueAt
in classBeanTableDataModel<E extends NamedBean>
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
Description copied from class:BeanTableDataModel
- Specified by:
setValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
setValueAt
in classBeanTableDataModel<E extends NamedBean>
-
doDelete
protected void doDelete(E bean)
Delete the bean after all the checking has been done.Deletes the NamedBean.
- Overrides:
doDelete
in classBeanTableDataModel<E extends NamedBean>
- Parameters:
bean
- of the NamedBean to delete
-
matchPropertyName
protected boolean matchPropertyName(java.beans.PropertyChangeEvent e)
Description copied from class:BeanTableDataModel
Is this property event announcing a change this table should display?Note that events will come both from the NamedBeans and also from the manager
- Overrides:
matchPropertyName
in classBeanTableDataModel<E extends NamedBean>
- Parameters:
e
- the event to match- Returns:
- true if the property name is of interest, false otherwise
-
getManager
public Manager<E> getManager()
Description copied from class:BeanTableDataModel
Get the Table Model Bean Manager. In many cases, especially around Model startup, this will be the Proxy Manager, which is then changed to the hardware specific manager.- Specified by:
getManager
in classBeanTableDataModel<E extends NamedBean>
- Returns:
- current Manager in use by the Model.
-
getBySystemName
public E getBySystemName(java.lang.String name)
- Specified by:
getBySystemName
in classBeanTableDataModel<E extends NamedBean>
-
getByUserName
public E getByUserName(java.lang.String name)
- Specified by:
getByUserName
in classBeanTableDataModel<E extends NamedBean>
-
getMasterClassName
protected java.lang.String getMasterClassName()
- Specified by:
getMasterClassName
in classBeanTableDataModel<E extends NamedBean>
-
configureTable
public void configureTable(javax.swing.JTable table)
Description copied from class:BeanTableDataModel
Configure a table to have our standard rows and columns. This is optional, in that other table formats can use this table model. But we put it here to help keep it consistent. This also persists the table user interface state.- Overrides:
configureTable
in classBeanTableDataModel<E extends NamedBean>
- Parameters:
table
-JTable
to configure
-
configDeleteColumn
protected void configDeleteColumn(javax.swing.JTable table)
Replace delete button with comboBox to edit/delete/copy/select NamedBean.- Overrides:
configDeleteColumn
in classBeanTableDataModel<E extends NamedBean>
- Parameters:
table
- name of the NamedBean JTable holding the column
-
clickOn
public void clickOn(NamedBean t)
Description copied from class:BeanTableDataModel
Process a click on The value cell.- Specified by:
clickOn
in classBeanTableDataModel<E extends NamedBean>
- Parameters:
t
- the Bean that has been clicked.
-
getValue
public java.lang.String getValue(java.lang.String s)
Description copied from class:BeanTableDataModel
Get the current Bean state value in human readable form.- Specified by:
getValue
in classBeanTableDataModel<E extends NamedBean>
- Parameters:
s
- System name of Bean.- Returns:
- state value in localised human readable form.
-
getBeanType
protected java.lang.String getBeanType()
Description copied from class:BeanTableDataModel
Get String of the Single Bean Type. In many cases the return is Bundle localised so should not be used for matching Bean types.- Overrides:
getBeanType
in classBeanTableDataModel<E extends NamedBean>
- Returns:
- Bean Type String.
-
-