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 intCLEARCOLstatic intWHENCOLstatic intWHERECOL-
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 voidclickOn(IdTag t)Process a click on The value cell.javax.swing.JButtonconfigureButton()voidconfigValueColumn(javax.swing.JTable table)IdTaggetBySystemName(java.lang.String name)IdTaggetByUserName(java.lang.String name)java.lang.Class<?>getColumnClass(int col)intgetColumnCount()Get Column Count INCLUDING Bean Property Columns.java.lang.StringgetColumnName(int col)Manager<IdTag>getManager()Get the Table Model Bean Manager.protected java.lang.StringgetMasterClassName()intgetPreferredWidth(int col)java.lang.StringgetValue(java.lang.String name)Get the current Bean state value in human readable form.java.lang.ObjectgetValueAt(int row, int col)SYSNAMECOL returns the actual Bean, NOT the System Name.booleanisCellEditable(int row, int col)protected booleanmatchPropertyName(java.beans.PropertyChangeEvent e)Is this property event announcing a change this table should display?voidpropertyChange(java.beans.PropertyChangeEvent e)protected voidsetManager(Manager<IdTag> mgr)Set the Model Bean Manager.voidsetValueAt(java.lang.Object value, int row, int col)-
Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, allowBlockNameChange, configDeleteColumn, configureJTable, configureTable, copySystemName, copyUserName, deleteBean, dispose, doDelete, editComment, exportToCSV, 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:BeanTableDataModelSet 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:
setManagerin 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:BeanTableDataModelGet the current Bean state value in human readable form.- Specified by:
getValuein 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:BeanTableDataModelGet 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:
getManagerin classBeanTableDataModel<IdTag>- Returns:
- current Manager in use by the Model.
-
getBySystemName
public IdTag getBySystemName(@Nonnull java.lang.String name)
- Specified by:
getBySystemNamein classBeanTableDataModel<IdTag>
-
getByUserName
public IdTag getByUserName(@Nonnull java.lang.String name)
- Specified by:
getByUserNamein classBeanTableDataModel<IdTag>
-
clickOn
public void clickOn(IdTag t)
Description copied from class:BeanTableDataModelProcess a click on The value cell.- Specified by:
clickOnin 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:
setValueAtin interfacejavax.swing.table.TableModel- Overrides:
setValueAtin classBeanTableDataModel<IdTag>
-
getColumnCount
public int getColumnCount()
Description copied from class:BeanTableDataModelGet Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCountin interfacejavax.swing.table.TableModel- Overrides:
getColumnCountin classBeanTableDataModel<IdTag>
-
getColumnName
public java.lang.String getColumnName(int col)
Description copied from class:BeanTableDataModel- Specified by:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein classBeanTableDataModel<IdTag>
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
Description copied from class:BeanTableDataModel- Specified by:
getColumnClassin interfacejavax.swing.table.TableModel- Overrides:
getColumnClassin classBeanTableDataModel<IdTag>
-
isCellEditable
public boolean isCellEditable(int row, int col)
Description copied from class:BeanTableDataModel- Specified by:
isCellEditablein interfacejavax.swing.table.TableModel- Overrides:
isCellEditablein classBeanTableDataModel<IdTag>
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
Description copied from class:BeanTableDataModelSYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAtin interfacejavax.swing.table.TableModel- Overrides:
getValueAtin classBeanTableDataModel<IdTag>
-
getPreferredWidth
public int getPreferredWidth(int col)
- Overrides:
getPreferredWidthin classBeanTableDataModel<IdTag>
-
configValueColumn
public void configValueColumn(javax.swing.JTable table)
- Overrides:
configValueColumnin classBeanTableDataModel<IdTag>
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Description copied from class:BeanTableDataModel- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener- Overrides:
propertyChangein 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:
matchPropertyNamein 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:
configureButtonin classBeanTableDataModel<IdTag>
-
getMasterClassName
protected java.lang.String getMasterClassName()
- Specified by:
getMasterClassNamein classBeanTableDataModel<IdTag>
-
-