public interface LazyParent<T>
A LazyParent is contained by a LazyParentNode. When the node is expanded the parent is asked to fetch its children. These children are then embedded into their own nodes and added to the tree. The children may themselves be LazyParents.
The children are fetched in their own SwingWorker, allowing non-UI blocking behavior of the tree. If the retrieval is taking any significant time to complete then a progress node appears in the tree informing the user of the child loading progress.
Usage: Implement LazyParent and create a new LazyParentNode for it, then add the node to a tree containing a DefaultTreeModel
Modifier and Type | Method and Description |
---|---|
javax.swing.SwingWorker<java.util.List<T>,java.lang.Object> |
getChildWorker()
Fetch the children of a node in the tree.
|
javax.swing.SwingWorker<java.util.List<T>,java.lang.Object> getChildWorker()
Children also may or may not be lazy themselves: If a child in the list also implements LazyParent then it will be wrapped in a LazyParentNode, otherwise the child object will be wrapped in a plain DefaultMutableTreeNode.