Interface ITreeDocument

All Superinterfaces:
IEventSource, IGenericDocument
All Known Implementing Classes:
AbstractTreeDocument, StaticTreeDocument

public interface ITreeDocument extends IEventSource, IGenericDocument
A tree document is used to represent hierarchical structures. Nodes of trees implement the INode interface. Tree document can be used to model simple trees as well as more complex table trees (see getColumnLabels()).
  • Method Details

    • getRoots

      List<? extends INode> getRoots()
      Get the list of tree roots.
      Returns:
      the list of roots, cannot be null. Typically contain a single item, empty list at best
    • getColumnLabels

      List<String> getColumnLabels()
      Provide column labels for table trees. A regular tree should return null.
      Returns:
      the column labels, in practice at least two elements
    • getInitialExpansionLevel

      int getInitialExpansionLevel()
      Get the ideal expansion level of the tree. Graphical clients should use this method when doing the initial rendering of a tree document.
      Returns:
      the initial expansion level. Special values are: 0 to signify "expand nothing"; -1 to signify "expand all".
    • coordinatesToAddress

      String coordinatesToAddress(INodeCoordinates coordinates)
      Convert node coordinates to an address understandable by the tree document and potentially the unit representing the document.

      Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.

      Parameters:
      coordinates - the node coordinates
      Returns:
      the address, null on error
    • addressToCoordinates

      INodeCoordinates addressToCoordinates(String address)
      Convert a node address to node coordinates.

      Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.

      Parameters:
      address - the input address
      Returns:
      the coordinates, null on error
    • getReferencedAddress

      default String getReferencedAddress(INode node)
      Retrieve the address referenced by the INode. In trees, some leafs may reference another INode.
      Parameters:
      node - INode to test
      Returns:
      the reference address (meaning the virtual content of the node) or null if not applicable.