Class StaticTreeDocument

All Implemented Interfaces:
IGenericDocument, ITreeDocument, IEventSource

@Ser public class StaticTreeDocument extends AbstractTreeDocument
A simple tree document. Such tree document objects do not listen to unit changes events; in fact, they are unaware of the IUnit family of classes. They are ideal to distribute static, immutable contents.

Clients should not extend this class. Clients requiring custom tree documents should either extend AbstractTreeDocument or implement ITreeDocument.

  • Constructor Details

    • StaticTreeDocument

      public StaticTreeDocument(INode root)
      Create a single-root static tree document.
      Parameters:
      root - tree root
    • StaticTreeDocument

      public StaticTreeDocument(List<? extends INode> roots)
      Create a static tree document.
      Parameters:
      roots - tree roots
    • StaticTreeDocument

      public StaticTreeDocument(List<? extends INode> roots, List<String> columnLabels, int initialExpansionLevel)
      Create a static tree or table-tree document.
      Parameters:
      roots - tree roots
      columnLabels - optional column labels for table trees
      initialExpansionLevel - suggested initial expansion level for clients
  • Method Details

    • getRoots

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

      public List<String> getColumnLabels()
      Description copied from interface: ITreeDocument
      Provide column labels for table trees. A regular tree should return null.
      Specified by:
      getColumnLabels in interface ITreeDocument
      Overrides:
      getColumnLabels in class AbstractTreeDocument
      Returns:
      the column labels, or null for a regular single-column tree
    • getInitialExpansionLevel

      public int getInitialExpansionLevel()
      Description copied from interface: ITreeDocument
      Get the ideal expansion level of the tree. Graphical clients should use this method when doing the initial rendering of a tree document.
      Specified by:
      getInitialExpansionLevel in interface ITreeDocument
      Overrides:
      getInitialExpansionLevel in class AbstractTreeDocument
      Returns:
      the initial expansion level. Special values are: 0 to signify "expand nothing"; -1 to signify "expand all".