Package org.cristalise.gui
Class DynamicTreeBuilder
java.lang.Object
org.cristalise.gui.tree.Node
org.cristalise.gui.DynamicTreeBuilder
- All Implemented Interfaces:
Runnable,NodeSubscriber
Installed as the user object on a single child node of a new node known to be composite.
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)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortstatic final shortstatic final shortstatic final shortshortFields inherited from class org.cristalise.gui.tree.Node
binding, childNodes, desktop, icon, isExpandable, itemPath, loader, name, subscribers, toolTip, treeNode, type -
Constructor Summary
ConstructorsConstructorDescriptionDynamicTreeBuilder(DefaultMutableTreeNode parent, ItemTabManager desktop) The newly created DynamicTreeBuilder records its parent node - the one for which it will build child nodes for. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidBefore the tree builder can execute, it needs to be given references to the tree and NodeFactory needed to create the new nodes.voidend(boolean more) getIcon()voidvoidvoidstart()toString()Used by the JTree to find the text representation of the node.Methods inherited from class org.cristalise.gui.tree.Node
createTreeNode, getChildNode, getDesktop, getIconName, getItemPath, getName, getPath, getPopupMenu, getToolTip, getTreeBuilder, getType, loadMore, makeExpandable, newNode, refresh, removeAllChildren, run, setIcon, setToolTip, setTreeNode, subscribeNode, unsubscribeNode
-
Field Details
-
state
public short state -
IDLE
public static final short IDLE- See Also:
-
LOADING
public static final short LOADING- See Also:
-
PARTIAL
public static final short PARTIAL- See Also:
-
FINISHED
public static final short FINISHED- See Also:
-
-
Constructor Details
-
DynamicTreeBuilder
The newly created DynamicTreeBuilder records its parent node - the one for which it will build child nodes for.- Parameters:
nodeClicked- The Parent Tree Node that will be populated.- See Also:
-
-
Method Details
-
buildInfo
Before the tree builder can execute, it needs to be given references to the tree and NodeFactory needed to create the new nodes.- Parameters:
parentTree- The JTree in which this node is currently contained.myNodeFactory- The NodeFactory that can be queried for new NodeItems.
-
start
public void start() -
toString
Used by the JTree to find the text representation of the node. -
getIcon
-
getTreeNode
- Overrides:
getTreeNodein classNode
-
add
- Specified by:
addin interfaceNodeSubscriber- Overrides:
addin classNode
-
end
public void end(boolean more) - Specified by:
endin interfaceNodeSubscriber- Overrides:
endin classNode
-
remove
- Specified by:
removein interfaceNodeSubscriber- Overrides:
removein classNode
-
loadChildren
public void loadChildren()- Specified by:
loadChildrenin classNode
-