Package jmri.jmrit.beantable
Class IdTagTableDataModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.beantable.BeanTableDataModel<IdTag>
-
- jmri.jmrit.beantable.IdTagTableDataModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
public class IdTagTableDataModel extends BeanTableDataModel<IdTag>
TableDataModel for an IdTag Table. Split fromIdTagTableAction
- 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
CLEARCOL
static int
WHENCOL
static int
WHERECOL
-
Fields inherited from class jmri.jmrit.beantable.BeanTableDataModel
COMMENTCOL, DELETECOL, NUMCOLUMN, SYSNAMECOL, sysNameList, USERNAMECOL, VALUECOL
-
-
Constructor Summary
Constructors Constructor Description IdTagTableDataModel(Manager<IdTag> mgr)
Create a new IdTag Table Data Model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clickOn(IdTag t)
Process a click on The value cell.javax.swing.JButton
configureButton()
void
configValueColumn(javax.swing.JTable table)
IdTag
getBySystemName(java.lang.String name)
IdTag
getByUserName(java.lang.String name)
java.lang.Class<?>
getColumnClass(int col)
int
getColumnCount()
Get Column Count INCLUDING Bean Property Columns.java.lang.String
getColumnName(int col)
Manager<IdTag>
getManager()
Get the Table Model Bean Manager.protected java.lang.String
getMasterClassName()
int
getPreferredWidth(int col)
java.lang.String
getValue(java.lang.String name)
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
propertyChange(java.beans.PropertyChangeEvent e)
protected void
setManager(Manager<IdTag> mgr)
Set the Model Bean Manager.void
setValueAt(java.lang.Object value, int row, int col)
-
Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, allowBlockNameChange, configDeleteColumn, configureJTable, configureTable, copyName, deleteBean, dispose, doDelete, editComment, formatToolTip, getBeanType, getCellToolTip, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPropertyColumnCount, getPropertyColumnDescriptor, getRowCount, isClearUserNameAllowed, makeJTable, moveBean, persistTable, printColumns, printTable, removeName, renameBean, setColumnIdentities, setColumnToHoldButton, setDisplayDeleteMsg, setFilter, 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
-
WHERECOL
public static final int WHERECOL
- See Also:
- Constant Field Values
-
WHENCOL
public static final int WHENCOL
- See Also:
- Constant Field Values
-
CLEARCOL
public static final int CLEARCOL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IdTagTableDataModel
public IdTagTableDataModel(Manager<IdTag> mgr)
Create a new IdTag Table Data Model.- Parameters:
mgr
- IdTag manager to use in the model, default IdTag Manager always used.
-
-
Method Detail
-
setManager
protected final void setManager(Manager<IdTag> mgr)
Description copied from class:BeanTableDataModel
Set the Model Bean Manager. Note that for many Models this may not work as the manager is currently obtained directly from the Action class.- Overrides:
setManager
in classBeanTableDataModel<IdTag>
- Parameters:
mgr
- Bean Manager that the Model should use.
-
getValue
public java.lang.String getValue(java.lang.String name)
Description copied from class:BeanTableDataModel
Get the current Bean state value in human readable form.- Specified by:
getValue
in classBeanTableDataModel<IdTag>
- Parameters:
name
- System name of Bean.- Returns:
- state value in localised human readable form.
-
getManager
public Manager<IdTag> 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<IdTag>
- Returns:
- current Manager in use by the Model.
-
getBySystemName
public IdTag getBySystemName(@Nonnull java.lang.String name)
- Specified by:
getBySystemName
in classBeanTableDataModel<IdTag>
-
getByUserName
public IdTag getByUserName(@Nonnull java.lang.String name)
- Specified by:
getByUserName
in classBeanTableDataModel<IdTag>
-
clickOn
public void clickOn(IdTag t)
Description copied from class:BeanTableDataModel
Process a click on The value cell.- Specified by:
clickOn
in classBeanTableDataModel<IdTag>
- Parameters:
t
- the Bean that has been clicked.
-
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<IdTag>
-
getColumnCount
public int getColumnCount()
Description copied from class:BeanTableDataModel
Get Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCount
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnCount
in classBeanTableDataModel<IdTag>
-
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<IdTag>
-
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<IdTag>
-
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<IdTag>
-
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<IdTag>
-
getPreferredWidth
public int getPreferredWidth(int col)
- Overrides:
getPreferredWidth
in classBeanTableDataModel<IdTag>
-
configValueColumn
public void configValueColumn(javax.swing.JTable table)
- Overrides:
configValueColumn
in classBeanTableDataModel<IdTag>
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Description copied from class:BeanTableDataModel
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
- Overrides:
propertyChange
in classBeanTableDataModel<IdTag>
-
matchPropertyName
protected boolean matchPropertyName(java.beans.PropertyChangeEvent e)
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 Do not update row on whereLastSeen as these are always followed by a whenLastSeen where we'll do a full data changed.
- Overrides:
matchPropertyName
in classBeanTableDataModel<IdTag>
- Parameters:
e
- the event to match- Returns:
- true if the property name is of interest, false otherwise
-
configureButton
public javax.swing.JButton configureButton()
- Overrides:
configureButton
in classBeanTableDataModel<IdTag>
-
getMasterClassName
protected java.lang.String getMasterClassName()
- Specified by:
getMasterClassName
in classBeanTableDataModel<IdTag>
-
-