Class AbstractTreeDocument

java.lang.Object
com.pnfsoftware.jeb.util.events.EventSource
com.pnfsoftware.jeb.core.output.tree.impl.AbstractTreeDocument
All Implemented Interfaces:
IGenericDocument, ITreeDocument, IEventSource
Direct Known Subclasses:
StaticTreeDocument

@Ser public abstract class AbstractTreeDocument extends EventSource implements ITreeDocument
An adapter for non-table trees. This class can be extended to serve as a base class for table trees as well, by overriding the getColumnLabels() method

The addressing system implemented in this adapter is trivial: it is a string representation of INodeCoordinates.

Example: coordinates: (0,10,4) -> address: "0,10,4"

Clients may also override dispose().

  • Constructor Details

    • AbstractTreeDocument

      public AbstractTreeDocument()
  • Method Details

    • dispose

      public void dispose()
      The default implementation does nothing.
      Specified by:
      dispose in interface IGenericDocument
    • getPropertyManager

      public IPropertyManager getPropertyManager()
      The default implementation returns null.
      Specified by:
      getPropertyManager in interface IGenericDocument
      Returns:
      a PM, null if none
    • 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
      Returns:
      the column labels, in practice at least two elements
    • 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
      Returns:
      the initial expansion level. Special values are: 0 to signify "expand nothing"; -1 to signify "expand all".
    • coordinatesToAddress

      public String coordinatesToAddress(INodeCoordinates coordinates)
      Description copied from interface: ITreeDocument
      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.

      Specified by:
      coordinatesToAddress in interface ITreeDocument
      Parameters:
      coordinates - the node coordinates
      Returns:
      the address, null on error
    • addressToCoordinates

      public INodeCoordinates addressToCoordinates(String address)
      Description copied from interface: ITreeDocument
      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.

      Specified by:
      addressToCoordinates in interface ITreeDocument
      Parameters:
      address - the input address
      Returns:
      the coordinates, null on error
    • coordinatesToAddress

      public String coordinatesToAddress(INodeCoordinates coordinates, Function<List<INode>,String> f)
      Helper method to build address from coordinates
      Parameters:
      coordinates - INodeCoordinates
      f - function
    • argument: list of INode representing the INode path
    • result: String address
    • Returns: