Class Node
java.lang.Object
com.pnfsoftware.jeb.core.output.tree.impl.Node
- All Implemented Interfaces:
IActionableItem,IItem,IVisualItem,IActionableNode,INode,IVisualNode
- Direct Known Subclasses:
KVNode
A simple implementation of an actionable node. The node
-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.output.IActionableItem
HAS_RELATED_ITEMS, ITEM_TYPE_IDENTITY, ITEM_TYPE_MASK, ROLE_MASTER -
Constructor Summary
ConstructorsConstructorDescriptionCreate 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. -
Method Summary
Modifier and TypeMethodDescriptionvoidString[]Get the additional labels for table trees.getChild(int index) Get the children of this node.Retrieve the item class id, if any.intGet the initial expansion level for this node.intRetrieve the item flags.longRetrieve the item id.getLabel()Get the primary label of this node.voidinsertChild(int index, Node child) voidremoveChild(int index) voidremoveChild(Node child) voidsetClassId(ItemClassIdentifiers classId) voidsetInitialExpansion(int expansionLevel) voidsetItemFlags(int flags) voidsetItemId(long itemId) void
-
Constructor Details
-
Node
Create a new node.- Parameters:
label- the label, without new-line characters
-
Node
Create a new node.- Parameters:
label- the label, without new-line charactersclassId- optional class identifier
-
Node
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 charactersclassId- optional class identifieritemId- optional item identifierflags- optional flagsinitialExpansion- true to let clients know that the node should be expanded upon first rendering (default is false)
-
-
Method Details
-
getLabel
Description copied from interface:INodeGet 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.
-
setLabel
-
getAdditionalLabels
Description copied from interface:INodeGet 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:
getAdditionalLabelsin interfaceINode- Returns:
- the list of additional labels. Example: If the table tree has 3 columns, that method should return at most 2 additional labels
-
addChild
-
insertChild
-
removeChild
-
removeChild
public void removeChild(int index) -
getChild
-
getChildren
Description copied from interface:INodeGet the children of this node.- Specified by:
getChildrenin interfaceINode- Returns:
- a list of children nodes, possibly empty
-
getClassId
Description copied from interface:IVisualItemRetrieve the item class id, if any.- Specified by:
getClassIdin interfaceIVisualItem- Returns:
- the class id, null if none
-
setClassId
-
getItemId
public long getItemId()Description copied from interface:IActionableItemRetrieve the item id.- Specified by:
getItemIdin interfaceIActionableItem- Returns:
- the item id, 0 if none
-
setItemId
public void setItemId(long itemId) -
getItemFlags
public int getItemFlags()Description copied from interface:IActionableItemRetrieve 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:
getItemFlagsin interfaceIActionableItem- Returns:
- the items flags
-
setItemFlags
public void setItemFlags(int flags) -
getInitialExpansion
public int getInitialExpansion()Description copied from interface:IVisualNodeGet 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:
getInitialExpansionin interfaceIVisualNode- Returns:
- currently, 1 or more means expand, 0 or less means do not expand
-
setInitialExpansion
public void setInitialExpansion(int expansionLevel)
-