public class EntityListTableModel<T extends Entity> extends Object implements TableModel
A table model that allows using a Table
to render and edit an EntityList.
TableModel.TableModelEvent
Constructor and Description |
---|
EntityListTableModel(EntityType rowType,
EntityList<T> entities,
TableColumns columnsNode) |
Modifier and Type | Method and Description |
---|---|
void |
addTableModelListener(ActionListener<TableModel.TableModelEvent> l)
Add a listener to be notified of changes to the model.
|
ContentType |
getCellContentType(int row,
int column)
Get the content type of a cell.
|
int |
getColumnCount()
Get the number of columns in the model.
|
FieldNode |
getColumnField(int column) |
String |
getColumnName(int column)
Get the name of the given column
|
Property |
getColumnProperty(int column) |
T |
getEntity(int row) |
EntityList<T> |
getEntityList() |
int |
getRowCount()
Get the number of rows in the model.
|
Object |
getValueAt(int rowIndex,
int columnIndex)
Get the value of a particular cell.
|
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Check if the cell is editable.
|
void |
removeTableModelListener(ActionListener<TableModel.TableModelEvent> l)
Remove a listener.
|
void |
setValueAt(Object value,
int rowIndex,
int columnIndex)
Set the value in a cell.
|
public EntityListTableModel(EntityType rowType, EntityList<T> entities, TableColumns columnsNode)
public ContentType getCellContentType(int row, int column)
TableModel
Get the content type of a cell.
getCellContentType
in interface TableModel
row
- The row.column
- The columnpublic int getColumnCount()
TableModel
Get the number of columns in the model.
getColumnCount
in interface TableModel
public String getColumnName(int column)
TableModel
Get the name of the given column
getColumnName
in interface TableModel
column
- The column numberpublic int getRowCount()
TableModel
Get the number of rows in the model.
getRowCount
in interface TableModel
public Object getValueAt(int rowIndex, int columnIndex)
TableModel
Get the value of a particular cell.
getValueAt
in interface TableModel
rowIndex
- The row of the cellcolumnIndex
- The column of the cellpublic boolean isCellEditable(int rowIndex, int columnIndex)
TableModel
Check if the cell is editable.
isCellEditable
in interface TableModel
rowIndex
- The rowcolumnIndex
- The columnpublic void setValueAt(Object value, int rowIndex, int columnIndex)
TableModel
Set the value in a cell.
setValueAt
in interface TableModel
value
- The value to set.rowIndex
- The rowcolumnIndex
- The columnpublic void addTableModelListener(ActionListener<TableModel.TableModelEvent> l)
TableModel
Add a listener to be notified of changes to the model.
addTableModelListener
in interface TableModel
public void removeTableModelListener(ActionListener<TableModel.TableModelEvent> l)
TableModel
Remove a listener.
removeTableModelListener
in interface TableModel
public Property getColumnProperty(int column)
public T getEntity(int row)
public FieldNode getColumnField(int column)
public EntityList<T> getEntityList()
Copyright © 2022. All Rights Reserved.