public class TreeNodeMaker
extends java.lang.Object
| Constructor and Description | 
|---|
TreeNodeMaker()  | 
TreeNodeMaker(boolean showChildren)
Creates a new TreeNodeMaker that specifically does or doesn't create child
 nodes as well. 
 | 
TreeNodeMaker(boolean showChildren,
             java.lang.String[] childTypes)
Creates a new TreeNodeMaker that specifically does or doesn't create child
 nodes of the given types as well. 
 | 
TreeNodeMaker(javax.swing.JTree tree)
Creates a TreeNodeMaker that performs the expanding of nodes off the
 event thread (provided the parameter is not null and the tree model is
 an instance of DefaultTreeModel). 
 | 
| Modifier and Type | Method and Description | 
|---|---|
javax.swing.tree.DefaultMutableTreeNode | 
createTreeNode(DBObject obj)
Creates a TreeNode using the defaults set on this TreeNodeMaker for child
 nodes for the given DBObject. 
 | 
javax.swing.tree.DefaultMutableTreeNode | 
createTreeNode(SQLFragment obj)
Creates a TreeNode using the defaults set on this TreeNodeMaker for child
 nodes for the given SQLFragment. 
 | 
javax.swing.tree.DefaultMutableTreeNode | 
createTreeNode(SQLFragment obj,
              boolean showAvailKids)
Creates a TreeNode using the defaults set on this TreeNodeMaker but gives
 an extra customisation - the ability to show available children - e.g. 
 | 
static void | 
expandAll(javax.swing.JTree tree)
Expands every row in a tree so that all leaves are showing. 
 | 
static javax.swing.tree.DefaultMutableTreeNode | 
findNode(java.lang.Object userObject,
        javax.swing.tree.DefaultMutableTreeNode root)
Looks for a node in the tree that has the given object as its user
 object. 
 | 
boolean | 
getShowChildren()
Gets whether child nodes are also created for a given object. 
 | 
static int | 
indexOfNode(javax.swing.tree.DefaultMutableTreeNode node,
           javax.swing.tree.DefaultMutableTreeNode parent)
Gets the index of the given node underneath its parent in a list of its
 direct children. 
 | 
void | 
setChildTypes(java.lang.String[] childTypes)
If child nodes are being created, the types of children for which nodes
 are created can be filtered by types. 
 | 
void | 
setDeepFKs(boolean boo)
Sets wether FKConstraint nodes should recurse to their referenced
 relations. 
 | 
void | 
setShowChildren(boolean boo)
Sets whether child nodes are also created for a given object. 
 | 
public TreeNodeMaker()
public TreeNodeMaker(javax.swing.JTree tree)
tree - the parent tree control. If this is null or getModel()
 does not return an instanceof DefaultTreeModel, this parameter has
 no effect.public TreeNodeMaker(boolean showChildren)
public TreeNodeMaker(boolean showChildren,
                     java.lang.String[] childTypes)
public void setShowChildren(boolean boo)
public boolean getShowChildren()
public void setChildTypes(java.lang.String[] childTypes)
public void setDeepFKs(boolean boo)
public javax.swing.tree.DefaultMutableTreeNode createTreeNode(DBObject obj)
public javax.swing.tree.DefaultMutableTreeNode createTreeNode(SQLFragment obj)
public javax.swing.tree.DefaultMutableTreeNode createTreeNode(SQLFragment obj, boolean showAvailKids)
public static int indexOfNode(javax.swing.tree.DefaultMutableTreeNode node,
                              javax.swing.tree.DefaultMutableTreeNode parent)
public static javax.swing.tree.DefaultMutableTreeNode findNode(java.lang.Object userObject,
                                                               javax.swing.tree.DefaultMutableTreeNode root)
userObject - the object to look forroot - the node to root the search frompublic static void expandAll(javax.swing.JTree tree)