All known implementing classes: DefaultTableViewModel, JCOTableViewModel
The TableViewModel interface specifies the methods the TableView will use to interrogate a tabular data model. The tableView can be set up to display any data model which implements the TableViewModel interface.
The TableView model uses vectors to supply the tableView with data. Visible columns are a subset of the data in your model.
The absolute position in the data source has to be calculated by the application.
Method |
Description |
Argument |
Return value |
addColumn |
Adds a column with the specified name to the visible columns. |
(java.lang.String colNam) |
TableColumn |
addKeyColumn |
Adds a key column. |
(int columnIndex) |
void |
getColumnAt |
Returns the column for the specified index. |
(int columnIndex) |
TableColumn |
getColumnCount |
Returns the number of columns in the model. |
() |
int |
getColumnName |
Returns the name of the column for the specified index. |
(int columnIndex) |
java.lang.String |
getColumns |
Returns a vector to the visible columns. |
() |
java.util.Vector |
getKeyColumn |
Returns the key column. |
() |
IndexedLinkedList |
getRowCount |
Returns the number of rows in the model. |
() |
int |
getValueAt |
Returns the value of the cell for the specified column and row index. |
(int rowInd, int colInd) |
|
getValueAt |
Returns the value of the cell for the specified column and row index. |
(int
rowInd, |
|
removeColumn |
Removes a visible column. The data source is not effected. |
(java.lang.String columnName) |
void |
setColumnName |
Sets the name of the column for the specified columnIndex to the specified columnName. |
(java.lang.String colNam, |
void |
setKeyColumn |
Sets the key column for the model. |
(int columnIndex) |
void |
setValueAt |
Sets the value for the specified location. |
(AbstractDataType aVal, |
void |
// Create a new table model with three columns and add data: |
How to setup and work with the onCellClick event
How to setup and work with the onHeaderClick event
How to setup and work with the onNavigate event
How to setup and work with the onRowSelection event