public class DynamicTreeBuilder extends Node implements NodeSubscriber
Shows 'Loading . . .' when the branch is opened, but a TreeExpansionListener attempts to fire this thread off in the first child node.
When started, this thread will retrieve all of the real child nodes and add them to its parent while removing itself (hopefully for garbage collection)
| Modifier and Type | Field and Description |
|---|---|
static short |
FINISHED |
static short |
IDLE |
static short |
LOADING |
static short |
PARTIAL |
short |
state |
binding, childNodes, desktop, icon, isExpandable, itemPath, loader, name, subscribers, toolTip, treeNode, type| Constructor and Description |
|---|
DynamicTreeBuilder(DefaultMutableTreeNode parent,
ItemTabManager desktop)
The newly created DynamicTreeBuilder records its parent node - the one for which it will build child nodes for.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Node newNode) |
void |
buildInfo(JTree parentTree)
Before the tree builder can execute, it needs to be given references to the tree and NodeFactory needed to create the new nodes.
|
void |
end(boolean more) |
ImageIcon |
getIcon() |
DefaultMutableTreeNode |
getTreeNode() |
void |
loadChildren() |
void |
remove(Path path) |
void |
start() |
String |
toString()
Used by the JTree to find the text representation of the node.
|
createTreeNode, getChildNode, getDesktop, getIconName, getItemPath, getName, getPath, getPopupMenu, getToolTip, getTreeBuilder, getType, loadMore, makeExpandable, newNode, refresh, removeAllChildren, run, setIcon, setToolTip, setTreeNode, subscribeNode, unsubscribeNodepublic short state
public static final short IDLE
public static final short LOADING
public static final short PARTIAL
public static final short FINISHED
public DynamicTreeBuilder(DefaultMutableTreeNode parent, ItemTabManager desktop)
nodeClicked - The Parent Tree Node that will be populated.NodeItem,
TreeDisplaypublic void buildInfo(JTree parentTree)
myNodeFactory - The NodeFactory that can be queried for new NodeItems.parentTree - The JTree in which this node is currently contained.public void start()
public String toString()
public DefaultMutableTreeNode getTreeNode()
getTreeNode in class Nodepublic void add(Node newNode)
add in interface NodeSubscriberadd in class Nodepublic void end(boolean more)
end in interface NodeSubscriberend in class Nodepublic void remove(Path path)
remove in interface NodeSubscriberremove in class Nodepublic void loadChildren()
loadChildren in class NodeCopyright © 1997–2019 CRISTAL-iSE. All rights reserved.