public class

Node

extends Object
implements IActionableNode
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.output.tree.impl.Node
Known Direct Subclasses

Class Overview

A simple implementation of an actionable node. The node

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.core.output.IActionableItem
Public Constructors
Node(String label)
Create a new node.
Node(String label, ItemClassIdentifiers classId)
Create a new node.
Node(String label, ItemClassIdentifiers classId, long itemId, int flags)
Create a new node.
Node(String label, ItemClassIdentifiers classId, long itemId, int flags, int initialExpansion)
Create a new node.
Public Methods
void addChild(Node child)
String[] getAdditionalLabels()
Get the additional labels for table trees.
Node getChild(int index)
List<Node> getChildren()
Get the children of this node.
ItemClassIdentifiers getClassId()
Retrieve the item class id, if any.
int getInitialExpansion()
Get the initial expansion level for this node.
int getItemFlags()
Retrieve the item flags.
long getItemId()
Retrieve the item id.
String getLabel()
Get the primary label of this node.
void insertChild(int index, Node child)
void removeChild(int index)
void removeChild(Node child)
void setClassId(ItemClassIdentifiers classId)
void setInitialExpansion(int expansionLevel)
void setItemFlags(int flags)
void setItemId(long itemId)
void setLabel(String label)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.output.IActionableItem
From interface com.pnfsoftware.jeb.core.output.IVisualItem
From interface com.pnfsoftware.jeb.core.output.tree.INode
From interface com.pnfsoftware.jeb.core.output.tree.IVisualNode

Public Constructors

public Node (String label)

Create a new node.

Parameters
label the label, without new-line characters

public Node (String label, ItemClassIdentifiers classId)

Create a new node.

Parameters
label the label, without new-line characters
classId optional class identifier

public Node (String label, ItemClassIdentifiers classId, long itemId, int flags)

Create a new 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)

Public Methods

public void addChild (Node child)

public String[] getAdditionalLabels ()

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.

Returns
  • the list of additional labels. Example: If the table tree has 3 columns, that method should return at most 2 additional labels

public Node getChild (int index)

public List<Node> getChildren ()

Get the children of this node.

Returns
  • a list of children nodes, possibly empty

public ItemClassIdentifiers getClassId ()

Retrieve the item class id, if any.

Returns
  • the class id, null if none

public int getInitialExpansion ()

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.

Returns
  • currently, 1 or more means expand, 0 or less means do not expand

public int getItemFlags ()

Retrieve the item flags. Currently, allowed flags are:
- ROLE_MASTER
- HAS_RELATED_ITEMS

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

Returns
  • the items flags

public long getItemId ()

Retrieve the item id.

Returns
  • the item id, 0 if none

public String getLabel ()

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.

Returns
  • the label

public void insertChild (int index, Node child)

public void removeChild (int index)

public void removeChild (Node child)

public void setClassId (ItemClassIdentifiers classId)

public void setInitialExpansion (int expansionLevel)

public void setItemFlags (int flags)

public void setItemId (long itemId)

public void setLabel (String label)