|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.grid.TreeTableUtils
public class TreeTableUtils
Constructor Summary | |
---|---|
TreeTableUtils()
|
Method Summary | |
---|---|
static Row |
getChildAt(TableModel model,
Row parent,
int index)
Get the child of the parent row in the designated index inside the table model. |
static int |
getChildIndex(TableModel model,
Row parent,
Row child)
Get the index of the child within the parent's children inside the table model. |
static List<Row> |
getChildren(TableModel model,
Row parent)
Get children list of the parent row inside the table model. |
static int |
getChildrenCount(TableModel model,
Row parent)
Get the direct children count of a row inside the table model. |
static int |
getDescendantCount(TableModel model,
Row parent,
boolean leafOnly,
boolean includeCollapsedNodes)
The method can only be used for any table model who has one inner model as TreeTableModel to find the current visible descendant count in that level. |
static List<Row> |
getDescendants(TableModel model,
Row parent,
boolean directChildOnly,
boolean leafOnly,
boolean includeCollapsedNodes)
Gets descendants list of the parent row inside the table model. |
static Row |
getRow(TableModel model,
int rowIndex)
Gets the row in the row index of the table model. |
static boolean |
hasDescendant(TableModel model,
Row parent,
boolean leafOnly,
boolean includeCollapsedNodes)
Gets if there is at least one descendant for the parent row in the model. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeTableUtils()
Method Detail |
---|
public static int getChildrenCount(TableModel model, Row parent)
getDescendantCount(javax.swing.table.TableModel, Row, boolean, boolean)
returns the count of its descendant.
model
- the table model. In most case, it should be an instance of ITreeTableModelparent
- the parent row
getChildren(javax.swing.table.TableModel, Row)
public static int getChildIndex(TableModel model, Row parent, Row child)
model
- the table model. In most case, it should be an instance of ITreeTableModelparent
- the parent rowchild
- the child row
getChildren(javax.swing.table.TableModel, Row)
public static Row getChildAt(TableModel model, Row parent, int index)
model
- the table model. In most case, it should be an instance of ITreeTableModelparent
- the parent rowindex
- the child index
getChildren(javax.swing.table.TableModel, Row)
public static Row getRow(TableModel model, int rowIndex)
model
- the table modelrowIndex
- the row index
public static List<Row> getChildren(TableModel model, Row parent)
model
- the table model. In most case, it should be an instance of ITreeTableModelparent
- the parent row
public static List<Row> getDescendants(TableModel model, Row parent, boolean directChildOnly, boolean leafOnly, boolean includeCollapsedNodes)
model
- the table model. In most case, it should be an instance of ITreeTableModelparent
- the parent rowdirectChildOnly
- the flag if only direct child should be returnedleafOnly
- the flag if only leaf descendants should be returnedincludeCollapsedNodes
- the flag if the collapsed nodes need to be included
public static boolean hasDescendant(TableModel model, Row parent, boolean leafOnly, boolean includeCollapsedNodes)
getDescendantCount(javax.swing.table.TableModel, Row, boolean, boolean)
since it will simply return true without looping all child nodes as long as it gets one visible child row.
model
- the outer table modelparent
- the Row to be queriedleafOnly
- the count will only include leaf children or notincludeCollapsedNodes
- if the collapsed nodes need to be included
public static int getDescendantCount(TableModel model, Row parent, boolean leafOnly, boolean includeCollapsedNodes)
TreeTableModel
to find the current visible descendant count in that level. It has two options,
leaf only or count collapsed nodes.
It could hit performance since we have to expand all to count the actual leaf nodes then set the original expansion
state back.
model
- the outer table modelparent
- the Row to be queriedleafOnly
- the count will only include leaf children or notincludeCollapsedNodes
- if the collapsed nodes need to be included
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |