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 TypeMethodDescriptionvoid
String[]
Get the additional labels for table trees.getChild
(int index) Get the children of this node.Retrieve the item class id, if any.int
Get the initial expansion level for this node.int
Retrieve the item flags.long
Retrieve the item id.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
-
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: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.
-
setLabel
-
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 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:INode
Get the children of this node.- Specified by:
getChildren
in interfaceINode
- Returns:
- a list of children nodes, possibly empty
-
getClassId
Description copied from interface:IVisualItem
Retrieve the item class id, if any.- Specified by:
getClassId
in interfaceIVisualItem
- Returns:
- the class id, null if none
-
setClassId
-
getItemId
public long getItemId()Description copied from interface:IActionableItem
Retrieve the item id.- Specified by:
getItemId
in interfaceIActionableItem
- 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 interfaceIActionableItem
- 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 interfaceIVisualNode
- Returns:
- currently, 1 or more means expand, 0 or less means do not expand
-
setInitialExpansion
public void setInitialExpansion(int expansionLevel)
-