|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the type of the node objectspublic interface ITreeTableModel<T>
A tree table extends a tree by adding the capability to display table columns
as well. This interface extends the Swing tree model with those additional
methods that allow the tree table to populate these columns with data. The
tree table model distinguishes between a key column and regular columns. The
values for the key column are returned via the getKey(Object)
method
while standard values are returned by getColumnValue(Object, int)
.
ITreeTableNode
,
DefaultMutableTreeTableNode
Method Summary | |
---|---|
void |
addTreeTableModelListener(ITreeTableModelListener l)
Adds a listener to the model, which will be informed when key or column values get changes. |
java.lang.Object |
getColumnValue(T node,
int columnModelIndex)
Returns an object for the given node that will be displayed in a tree table column where the column's model index matches the given index. |
java.lang.Object |
getKey(T node)
Returns an object for the given node that will be displayed in the tree table's key column. |
java.lang.Object |
getRowHeaderValue(T node)
Returns an object that will be visualized in the row header section of the Gantt chart. |
void |
removeTreeTableModelListener(ITreeTableModelListener l)
Removes a listener from the model. |
void |
setColumnValue(T node,
java.lang.Object value,
int columnModelIndex)
Sets a new column value for the given node and model index. |
void |
setKey(T node,
java.lang.Object key)
Sets a new object to be used as the key object for the given tree table node. |
void |
sort(T node,
int[] modelIndices,
boolean[] sortDirections)
Invokes multi-column sorting on the tree table model. |
Methods inherited from interface javax.swing.tree.TreeModel |
---|
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged |
Method Detail |
---|
java.lang.Object getKey(T node)
node
- the tree table's node for which to return a key object
setKey(Object, Object)
void setKey(T node, java.lang.Object key)
node
- the node for which to specify a new key objectkey
- the node's new key objectgetKey(Object)
java.lang.Object getColumnValue(T node, int columnModelIndex)
node
- the node for which to return a column value objectcolumnModelIndex
- the column's model index
setColumnValue(Object, Object, int)
void setColumnValue(T node, java.lang.Object value, int columnModelIndex)
It is very important to note the difference between the model index and a columns index within a given column model. The model index usually never changes and is used to lookup the correct piece of information from some kind of data model. The other index is simply the columns current position within the model. This index can change if the user or the application rearranges the columns.
node
- the node that will receive a new column valuevalue
- the new column valuecolumnModelIndex
- the model index that will get changedgetColumnValue(Object, int)
,
INodeEditPolicy.isValueEditable(Object, ITreeTableModel, int)
,
INodeEditPolicy.getChangeValueCommand(Object, ITreeTableModel,
Object, int)
java.lang.Object getRowHeaderValue(T node)
node
- the node for which to return a header value
void sort(T node, int[] modelIndices, boolean[] sortDirections)
node
- the node that is the target of the sort, the node's children
will be sorted (if the node is the root then the entire table
will be sorted)modelIndices
- the model indices that are used to determine which column
values to compare for sorting (use
KeyColumn.MODEL_INDEX
to specify a sort based on the
key columnsortDirections
- if TRUE the sort direction will be ascendingvoid addTreeTableModelListener(ITreeTableModelListener l)
l
- the listener to addremoveTreeTableModelListener(ITreeTableModelListener)
void removeTreeTableModelListener(ITreeTableModelListener l)
l
- the listener to removeaddTreeTableModelListener(ITreeTableModelListener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |