|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
org.jurvis.swing.tree.JvDynamicTreeNode
public class JvDynamicTreeNode
A DefaultMutableTreeNode that permits on-demand loading of
children. Frequently, to improve performance, children nodes are only
loaded as the user expands the node. This class provides a standard means
of lazily loading children nodes via the doChildrenQuery() method.
| Field Summary | |
|---|---|
protected boolean |
wasQueried
True if this node has been queried for its children. |
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
| Constructor Summary | |
|---|---|
JvDynamicTreeNode(Object userObject)
Construct a JvDynamicTreeNode. |
|
| Method Summary | |
|---|---|
Enumeration |
children()
Returns the children of the reciever as an Enumeration. |
protected boolean |
doChildrenQuery()
Determine if this node has any children and link them to this node. |
TreeNode |
getChildAt(int childIndex)
Returns the child TreeNode at index
childIndex. |
int |
getChildCount()
Returns the number of children TreeNodes the receiver
contains. |
boolean |
wasQueried()
Returns true if the children of the node have been queried for. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean wasQueried
| Constructor Detail |
|---|
public JvDynamicTreeNode(Object userObject)
JvDynamicTreeNode.
userObject - the object that constitutes the node's data| Method Detail |
|---|
public boolean wasQueried()
public TreeNode getChildAt(int childIndex)
TreeNode at index
childIndex.
getChildAt in interface TreeNodegetChildAt in class DefaultMutableTreeNodepublic int getChildCount()
TreeNodes the receiver
contains.
getChildCount in interface TreeNodegetChildCount in class DefaultMutableTreeNodepublic Enumeration children()
children in interface TreeNodechildren in class DefaultMutableTreeNodeprotected boolean doChildrenQuery()
Note that a very common error is to forget to set the parent link of each child. Symptoms of this problem include the inability to programmatically expand or select nodes.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||