java.lang.Object
com.pnfsoftware.jeb.core.output.tree.impl.Node
All Implemented Interfaces:
IActionableItem, IItem, IVisualItem, IActionableNode, INode, IVisualNode
Direct Known Subclasses:
KVNode

@Ser public class Node extends Object implements IActionableNode
A simple implementation of an actionable node. The node
  • Constructor Details

    • Node

      public Node(String label)
      Create a new node.
      Parameters:
      label - the label, without new-line characters
    • Node

      public Node(String label, ItemClassIdentifiers classId)
      Create a new node.
      Parameters:
      label - the label, without new-line characters
      classId - optional class identifier
    • Node

      public Node(String label, ItemClassIdentifiers classId, long itemId, int flags)
      Create a new node.
      Parameters:
      label -
      classId -
      itemId -
      flags -
    • Node

      public Node(String label, ItemClassIdentifiers classId, long itemId, int flags, int initialExpansion)
      Create a new node.
      Parameters:
      label - the label, without new-line characters
      classId - optional class identifier
      itemId - optional item identifier
      flags - optional flags
      initialExpansion - true to let clients know that the node should be expanded upon first rendering (default is false)
  • Method Details

    • getLabel

      public String getLabel()
      Description copied from interface: INode
      Get the primary label of this node. That label is used by simple trees as the primary label, or as the first label in a row for table trees.

      It is recommended to avoid new-line characters in the label. If new line characters are found, what happens to them is client-specific.

      Specified by:
      getLabel in interface INode
      Returns:
      the label
    • setLabel

      public void setLabel(String label)
    • getAdditionalLabels

      public String[] getAdditionalLabels()
      Description copied from interface: INode
      Get the additional labels for table trees. Simple trees should return null.

      It is recommended to avoid new-line characters in the label. If new line characters are found, what happens to them is client-specific.

      Specified by:
      getAdditionalLabels in interface INode
      Returns:
      the list of additional labels. Example: If the table tree has 3 columns, that method should return at most 2 additional labels
    • addChild

      public void addChild(Node child)
    • insertChild

      public void insertChild(int index, Node child)
    • removeChild

      public void removeChild(Node child)
    • removeChild

      public void removeChild(int index)
    • getChild

      public Node getChild(int index)
    • getChildren

      public List<Node> getChildren()
      Description copied from interface: INode
      Get the children of this node.
      Specified by:
      getChildren in interface INode
      Returns:
      a list of children nodes, possibly empty
    • getClassId

      public ItemClassIdentifiers getClassId()
      Description copied from interface: IVisualItem
      Retrieve the item class id, if any.
      Specified by:
      getClassId in interface IVisualItem
      Returns:
      the class id, null if none
    • setClassId

      public void setClassId(ItemClassIdentifiers classId)
    • getItemId

      public long getItemId()
      Description copied from interface: IActionableItem
      Retrieve the item id.
      Specified by:
      getItemId in interface IActionableItem
      Returns:
      the item id, 0 if none
    • setItemId

      public void setItemId(long itemId)
    • getItemFlags

      public int getItemFlags()
      Description copied from interface: IActionableItem
      Retrieve the item flags. Currently, allowed flags are:
      - IActionableItem.ROLE_MASTER
      - IActionableItem.HAS_RELATED_ITEMS

      For code nodes, this is not to be confused with the generic flags.

      Specified by:
      getItemFlags in interface IActionableItem
      Returns:
      the items flags
    • setItemFlags

      public void setItemFlags(int flags)
    • getInitialExpansion

      public int getInitialExpansion()
      Description copied from interface: IVisualNode
      Get the initial expansion level for this node. This value can be used as a hint by UI clients, when they display the node for the first time.
      Specified by:
      getInitialExpansion in interface IVisualNode
      Returns:
      currently, 1 or more means expand, 0 or less means do not expand
    • setInitialExpansion

      public void setInitialExpansion(int expansionLevel)