com.dlsc.flexgantt.model.treetable
Class KeyColumn<T>
java.lang.Object
com.dlsc.flexgantt.util.NamedObject
com.dlsc.flexgantt.model.treetable.TreeTableColumn<T>
com.dlsc.flexgantt.model.treetable.KeyColumn<T>
- Type Parameters:
T
- the object type of the header value
- All Implemented Interfaces:
- INamedObject, java.lang.Comparable<INamedObject>
public class KeyColumn<T>
- extends TreeTableColumn<T>
The key column is a special type of tree table column and responsible for
showing the tree structure given by a tree table model. Usually this column
is the first (left-most) column in the table (except if changed via
AbstractGanttChart.setKeyColumnPosition(int)
). The key column always
returns MODEL_INDEX
as its model index.
- Since:
- 1.0
- Author:
- Dirk Lemmermann
- See Also:
IColumnModel
,
AbstractGanttChart.setKeyColumnPosition(int)
,
ITreeTableModel.getKey(Object)
,
ColumnModelIterator
Field Summary |
static int |
MODEL_INDEX
The model index of the key column is stored in this static class member. |
Constructor Summary |
KeyColumn(java.lang.String name,
java.lang.Class columnClass)
Constructs a new key column object with the given name. |
Method Summary |
int |
getModelIndex()
Overriden and made final in order to ensure that the model index returned
by this method is always MODEL_INDEX (identifying the
column as the key column). |
void |
setModelIndex(int newIndex)
Overriden and made final in order to ensure that the model index can not
be modified. |
Methods inherited from class com.dlsc.flexgantt.model.treetable.TreeTableColumn |
getColumnClass, getHeaderValue, getMaximumWidth, getMinimumWidth, getSupportedSortDirections, getWidth, isSortable, isSupported, setColumnClass, setHeaderValue, setMaximumWidth, setMinimumWidth, setSupportedSortDirections, setWidth, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MODEL_INDEX
public static final int MODEL_INDEX
- The model index of the key column is stored in this static class member.
It gets references throughout the framework to check whether a column is
used as a key column or as a 'regular' value column.
- Since:
- 1.0
- See Also:
- Constant Field Values
KeyColumn
public KeyColumn(java.lang.String name,
java.lang.Class columnClass)
- Constructs a new key column object with the given name. The column class
specifies which kind of objects will be shown in this column. This
information is required for the cell editor and renderer lookup.
- Parameters:
name
- the name of the column (used for sorting and in menus)columnClass
- the type of objects shown in the column's cells- Since:
- 1.0
- See Also:
IColumnHeaderRenderer
,
TreeTable.getCellRenderer(Class)
,
TreeTable.getCellEditor(Class)
setModelIndex
public final void setModelIndex(int newIndex)
- Overriden and made final in order to ensure that the model index can not
be modified. The key column has to return the index
MODEL_INDEX
to identify itself as the key column.
- Overrides:
setModelIndex
in class TreeTableColumn<T>
- Since:
- 1.0
- See Also:
TreeTableColumn.setModelIndex(int)
getModelIndex
public final int getModelIndex()
- Overriden and made final in order to ensure that the model index returned
by this method is always
MODEL_INDEX
(identifying the
column as the key column).
- Overrides:
getModelIndex
in class TreeTableColumn<T>
- Returns:
- the column's model index that is used to lookup date from a data
model
- Since:
- 1.0