Package org.bgerp.model.base.tree
Class TreeItem<T,C extends TreeItem<T,C>>
java.lang.Object
org.bgerp.model.base.tree.TreeItem<T,C>
- Type Parameters:
T- type of node IDC- inherited subtype of node
- Direct Known Subclasses:
IdStringTitleTreeItem,IdTitleTreeItem,InetDevice,InetService,ProcessCreateType,ProcessType
Generic tree node item
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFinds node by ID over the node itself and all the children recursively.intgetIcon()getId()getTitle()booleanisInPathTo(Set<T> ids) Checks is ID set contains the item's ID or ID of any child of itprotected abstract booleanprotected booleanisRootNodeWithIntegerId(Integer id, Integer parentId) voidsetChildren(List<C> children) voidvoidsetParentId(T parentId) void
-
Field Details
-
id
-
parentId
-
title
-
children
-
-
Constructor Details
-
TreeItem
public TreeItem()
-
-
Method Details
-
getId
-
setId
-
getParentId
-
setParentId
-
getTitle
-
setTitle
-
getChildren
-
setChildren
-
addChild
-
getChild
-
getById
Finds node by ID over the node itself and all the children recursively.- Parameters:
id- the ID.- Returns:
- found node or
null.
-
getChildCount
public int getChildCount() -
getChildIds
-
getAllChildIds
- Returns:
- set with the node ID and all child IDs from all levels.
-
getIcon
- Returns:
- icon HTML.
-
getTextStyle
- Returns:
- style attribute for text span.
-
isRootNode
protected abstract boolean isRootNode() -
isRootNodeWithIntegerId
-
isInPathTo
Checks is ID set contains the item's ID or ID of any child of it- Parameters:
ids- the IDs- Returns:
-