Interface TreeSelectionPane.Model

Enclosing class:
TreeSelectionPane

public static interface TreeSelectionPane.Model
The model for the tree whose nodes can be selected in a TreeSelectionPane.
  • Method Details

    • getRoot

      Object getRoot()
      Get the root node of the tree.
      Returns:
      the root node of the tree
    • getChildCount

      int getChildCount(Object node)
      Get the number of children for a node.
      Parameters:
      node - the node for which the number of children is required
      Returns:
      the number of children of the specified node
    • getChild

      Object getChild(Object node, int index)
      Get a specific child of a node.
      Parameters:
      node - the node for which the child is required
      index - the index of the desired child; this should be in the range [0..getChildCount())
      Returns:
      the specified child node
    • getName

      String getName(Object node)
      Get the name of a node. The name should identify the child within the set of its parent's children.
      Parameters:
      node - the node for which the name is required
      Returns:
      the name of the node
    • getPath

      String getPath(Object node)
      Get the path of a node. The path is a series of names, separated by '/', which identify successive children, initially relative to the root node.
      Parameters:
      node - the node for which the path is required
      Returns:
      the path of the node
    • isLeaf

      boolean isLeaf(Object node)
      Check whether or not a node is a leaf node. This is simply a semantic distinction for a node, that will be used to determine how the node should be displayed; it is independent of whether a node has any children or not.
      Parameters:
      node - the node to be checked
      Returns:
      true if the node is a leaf node, and false otherwise