java.lang.Object javax.swing.tree.DefaultMutableTreeNode javax.swing.JTree.DynamicUtilTreeNode
public static class JTree.DynamicUtilTreeNode
DynamicUtilTreeNode can wrap vectors/hashtables/arrays/strings and create the appropriate children tree nodes as necessary. It is dynamic in that it will only create the children as necessary.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans TM has been added to the java.beans package. Please see XMLEncoder .
Field Summary | |
---|---|
protected Object |
childValue
Value to create children with. |
protected boolean |
hasChildren
Does the this JTree have children? This property is currently not implemented. |
protected boolean |
loadedChildren
Have the children been loaded yet? |
Fields inherited from class javax.swing.tree. DefaultMutableTreeNode |
---|
allowsChildren , children , EMPTY_ENUMERATION , parent , userObject |
Constructor Summary | |
---|---|
JTree.DynamicUtilTreeNode
(
Object
value,
Object
children) Creates a node with the specified object as its value and with the specified children. |
Method Summary | |
---|---|
Enumeration
|
children
() Subclassed to load the children, if necessary. |
static void |
createChildren
(
DefaultMutableTreeNode
parent,
Object
children) Adds to parent all the children in children. |
TreeNode |
getChildAt
(int index) Subclassed to load the children, if necessary. |
int |
getChildCount
() Returns the number of child nodes. |
boolean |
isLeaf
() Returns true if this node allows children. |
protected void |
loadChildren
() Loads the children based on childValue. |
Methods inherited from class javax.swing.tree. DefaultMutableTreeNode |
---|
add , breadthFirstEnumeration , clone , depthFirstEnumeration , getAllowsChildren , getChildAfter , getChildBefore , getDepth , getFirstChild , getFirstLeaf , getIndex , getLastChild , getLastLeaf , getLeafCount , getLevel , getNextLeaf , getNextNode , getNextSibling , getParent , getPath , getPathToRoot , getPreviousLeaf , getPreviousNode , getPreviousSibling , getRoot , getSharedAncestor , getSiblingCount , getUserObject , getUserObjectPath , insert , isNodeAncestor , isNodeChild , isNodeDescendant , isNodeRelated , isNodeSibling , isRoot , pathFromAncestorEnumeration , postorderEnumeration , preorderEnumeration , remove , remove , removeAllChildren , removeFromParent , setAllowsChildren , setParent , setUserObject , toString |
Methods inherited from class java.lang. Object |
---|
equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
Field Detail |
---|
protected boolean hasChildren
protected Object childValue
protected boolean loadedChildren
Constructor Detail |
---|
public JTree.DynamicUtilTreeNode(Object value, Object children)
Method Detail |
---|
public static void createChildren(DefaultMutableTreeNode parent, Object children)
public boolean isLeaf()
public int getChildCount()
protected void loadChildren()
public TreeNode getChildAt(int index)
public Enumeration<TreeNode>children()