|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
org.knime.core.node.tableview.TableRowHeaderModel
public class TableRowHeaderModel
Model for a Row Header view in a table view that displays a
DataTable
. This model has exactly one column
that contains the keys (type DataCell
) of
the DataRow
s in the
underlying DataTable
. The view to this model
is a TableRowHeaderView
which can
be located, for instance, in a scroll pane's row header view.
An instance of this class always corresponds to an instance of
TableContentModel
.
TableContentModel
,
Serialized FormField Summary |
---|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
TableRowHeaderModel(TableModel content)
Instantiates a new TableRowHeaderModel based on a
TableModel . |
Method Summary | |
---|---|
ColorAttr |
getColorAttr(int row)
Delegating method to TableContentModel . |
Class<DataCell> |
getColumnClass(int columnIndex)
Return DataCell.class since the key of a
DataRow is a DataCell . |
int |
getColumnCount()
Returns 1. |
String |
getColumnName(int column)
Returns "Key" as default row header name. |
int |
getRowCount()
Returns row count as in TableContentModel . |
Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the key of the row with index rowIndex . |
boolean |
isHiLit(int row)
Delegating method to TableContentModel . |
(package private) boolean |
isRowCountFinal()
Return false if the underlying table is an instance
of TableContentModel and its row count is not final (indicating
that the table has not been traversed to the very end). |
void |
setColumnName(String newName)
Sets a new name for this column. |
void |
setTableContent(TableModel content)
Set the table content to which this class will listen and whose content is content of this class. |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
TableRowHeaderModel(TableModel content)
TableRowHeaderModel
based on a
TableModel
. In case the argument is instance of
TableContentInterface
, this object will delegate
to it and retrieve information (row key, hilite status, etc) from it.
In case it's an ordinary table model, an adapter is created that always
returns default row keys (named "default" and none of the rows will be
hilited). This constructor is used in the method
TableRowHeaderView.createHeaderView(javax.swing.JTable)
and
shouldn't be called from anywhere else.
content
- the model for the content to this row header
NullPointerException
- if argument is null
Method Detail |
---|
public int getColumnCount()
public int getRowCount()
TableContentModel
.
getContentModel().getRowCount()
TableContentModel.getRowCount()
public Object getValueAt(int rowIndex, int columnIndex)
rowIndex
.
rowIndex
- the row of interestcolumnIndex
- must be 0
DataRow
(type DataCell
)
IndexOutOfBoundsException
- if columnIndex
is not 0 or
rowIndex
violates its rangepublic Class<DataCell> getColumnClass(int columnIndex)
DataCell.class
since the key of a
DataRow
is a DataCell
.
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
columnIndex
- must be 0
DataCell.class
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
column
- must be 0
IndexOutOfBoundsException
- if column is not 0public void setColumnName(String newName)
newName
- the new name or null
to have no column namepublic void setTableContent(TableModel content)
TableContentInterface
, this model will be a very dumb model:
It will not show any row keys and also no hilighting nor color
information.
content
- the new model
IllegalArgumentException
- if argument is null
boolean isRowCountFinal()
false
if the underlying table is an instance
of TableContentModel
and its row count is not final (indicating
that the table has not been traversed to the very end). In all other
cases return true
.
public boolean isHiLit(int row)
TableContentModel
.
row
- row index of interest
row
.TableContentModel.isHiLit(int)
public ColorAttr getColorAttr(int row)
TableContentModel
.
row
- row index of interest
TableContentModel.getColorAttr(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |