Class DynamicTreeBuilder

java.lang.Object
org.cristalise.gui.tree.Node
org.cristalise.gui.DynamicTreeBuilder
All Implemented Interfaces:
Runnable, NodeSubscriber

public class DynamicTreeBuilder extends Node implements 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 Details

  • Constructor Details

    • DynamicTreeBuilder

      public DynamicTreeBuilder(DefaultMutableTreeNode parent, ItemTabManager desktop)
      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:
      • NodeItem
      • invalid reference
        TreeDisplay
  • Method Details

    • buildInfo

      public 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.
      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

      public String toString()
      Used by the JTree to find the text representation of the node.
      Overrides:
      toString in class Node
    • getIcon

      public ImageIcon getIcon()
      Overrides:
      getIcon in class Node
    • getTreeNode

      public DefaultMutableTreeNode getTreeNode()
      Overrides:
      getTreeNode in class Node
    • add

      public void add(Node newNode)
      Specified by:
      add in interface NodeSubscriber
      Overrides:
      add in class Node
    • end

      public void end(boolean more)
      Specified by:
      end in interface NodeSubscriber
      Overrides:
      end in class Node
    • remove

      public void remove(Path path)
      Specified by:
      remove in interface NodeSubscriber
      Overrides:
      remove in class Node
    • loadChildren

      public void loadChildren()
      Specified by:
      loadChildren in class Node