Interface TreePopulator
- All Known Implementing Classes:
DefaultTreePopulator
public interface TreePopulator
Populates a tree from a base
Treeitem. It aims to create a tree under some Treeitem with TreeNodeData or
adding new tree node to an existing tree.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAncestor(IntegrationMapKeyDTO integrationMapKeyDTO) Add a key at the end of the ancestors deque.org.zkoss.zul.TreeitemappendTreeitem(org.zkoss.zul.Treeitem parent, TreeNodeData tnd) determineTreeitemAncestors(org.zkoss.zul.Treeitem treeitem) Find all ancestors for a given tree item.populateTree(org.zkoss.zul.Treeitem parent, IntegrationObjectDefinition existingDefinitions, IntegrationObjectDefinition currentAttributesMap, Set<SubtypeData> subtypeDataSet) Populates a tree iteratively.voidpopulateTreeSelectedMode(org.zkoss.zul.Treeitem parent, IntegrationObjectDefinition existingDefinitions, Set<SubtypeData> subtypeDataSet) Populates a tree iteratively, but only with selectedAbstractListItemDTO.voidReset class state by clearing the deque of ancestors.voidsetAncestors(Deque<IntegrationMapKeyDTO> ancestors) Set the ancestors.
-
Method Details
-
determineTreeitemAncestors
Find all ancestors for a given tree item. The ancestors will be ordered from the root tree item to the given tree item.- Parameters:
treeitem- the tree item for which its ancestors will be determined.- Returns:
- a deque of the tree item's ancestors.
-
appendTreeitem
- Parameters:
parent- the tree node under which a new tree node is adding.tnd- contains the data needed to create a new tree node.- Returns:
- the newly created tree node with tnd.
-
populateTree
IntegrationObjectDefinition populateTree(org.zkoss.zul.Treeitem parent, IntegrationObjectDefinition existingDefinitions, IntegrationObjectDefinition currentAttributesMap, Set<SubtypeData> subtypeDataSet) Populates a tree iteratively.- Parameters:
parent- new tree node will be created and added to this object and works as parent for iteration.existingDefinitions- a map that contains IntegrationMapKeyDTOs and lists of ListItemDTOs which are selected. Normally it is converted by DataStructureBuilder with the selected IO that reflected its IntegrationObjectItem as key and ListItemDTO from IntegrationObjectItemAttribute as value.currentAttributesMap- a map that contains all the IntegrationMapKeyDTOs that related to the IntegrationObject and its list of ListItemDTO.subtypeDataSet- a set that helps to determine the real type of a TreeNode. Could be a subtype of the original type.
-
populateTreeSelectedMode
void populateTreeSelectedMode(org.zkoss.zul.Treeitem parent, IntegrationObjectDefinition existingDefinitions, Set<SubtypeData> subtypeDataSet) Populates a tree iteratively, but only with selectedAbstractListItemDTO.- Parameters:
parent- tree item on which new child tree items will be appended to in the current iteration.existingDefinitions- a map that contains IntegrationMapKeyDTOs and lists of ListItemDTOs which are selected.subtypeDataSet- a set that helps to determine the real type of a TreeNode. Could be a subtype of the original type.
-
resetState
void resetState()Reset class state by clearing the deque of ancestors. -
setAncestors
Set the ancestors. For any tree node, the populator will not create child tree nodes that is an ancestor.- Parameters:
ancestors- the deque of ancestors.
-
addAncestor
Add a key at the end of the ancestors deque.- Parameters:
integrationMapKeyDTO- the key to be added to the ancestors deque.
-