Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.javatools.ui.tree.lazy
Class LazyParentNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by oracle.javatools.ui.tree.lazy.LazyParentNode

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class LazyParentNode
extends javax.swing.tree.DefaultMutableTreeNode

A LazyParentNode is a type of DefaultMutableTreeNode that doesn't compute its children until the user attempts to expand the node. Thus avoiding expensive creation of child nodes that might never be seen by the users.

To use: Create an implementation of LazyParent which fetches the children, create a LazyParentNode and add it to a tree's DefaultTreeModel

The LazyParent instance given at construction time is set as the 'UserObject' of this DefaultMutableTreeNode.

If the process to determine the children takes any significant time then a temporary LazyProgressNode is displayed in the tree to give the user feedback on what's happening.

See Also:
Serialized Form

Field Summary

 

Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject

 

Constructor Summary
LazyParentNode(javax.swing.tree.DefaultTreeModel treeModel, LazyParent lazyParent)
          Create a LazyParentNode.
LazyParentNode(javax.swing.tree.DefaultTreeModel treeModel, LazyParent lazyParent, LazyProgressController controller)
          Create a LazyParentNode.

 

Method Summary

 

Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, 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

 

Constructor Detail

LazyParentNode

public LazyParentNode(javax.swing.tree.DefaultTreeModel treeModel,
                      LazyParent lazyParent)
Create a LazyParentNode. The LazyParent instance is set as the 'UserObject' of this node. Expanding this node will cause a fetch of the nodes children.

LazyParentNode

public LazyParentNode(javax.swing.tree.DefaultTreeModel treeModel,
                      LazyParent lazyParent,
                      LazyProgressController controller)
Create a LazyParentNode. The LazyParent instance is set as the 'UserObject' of this node. Expanding this node will cause a fetch of the nodes children.

The controller will inform listeners whether any progress nodes in this tree are currently fetching their children and has the ability to cancel fetching.

Parameters:
treeModel - The DefaultTreeModel of the tree containing the nodes
lazyParent - A LazyParent implementation that will fetch the children of this node
controller - a controller to track all of nodes in the tree

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.