Class DefaultTreePopulator
java.lang.Object
de.hybris.platform.integrationbackoffice.widgets.modeling.builders.DefaultTreePopulator
- All Implemented Interfaces:
TreePopulator
Default implementation of
TreePopulator.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTreePopulator(@NotNull EditorAttributesFilteringService editorAttrFilterService, @NotNull DataStructureBuilder dataStructureBuilder, @NotNull TreeNodeDataSetGenerator treeNodeDataSetGenerator) Default constructor ofDefaultTreePopulator. -
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.
-
Constructor Details
-
DefaultTreePopulator
public DefaultTreePopulator(@NotNull @NotNull EditorAttributesFilteringService editorAttrFilterService, @NotNull @NotNull DataStructureBuilder dataStructureBuilder, @NotNull @NotNull TreeNodeDataSetGenerator treeNodeDataSetGenerator) Default constructor ofDefaultTreePopulator.- Parameters:
editorAttrFilterService- service that filters attributes.dataStructureBuilder- service to perform operations onIntegrationObjectDefinition.treeNodeDataSetGenerator- service to generateTreeNodeData.
-
-
Method Details
-
determineTreeitemAncestors
Description copied from interface:TreePopulatorFind all ancestors for a given tree item. The ancestors will be ordered from the root tree item to the given tree item.- Specified by:
determineTreeitemAncestorsin interfaceTreePopulator- Parameters:
treeitem- the tree item for which its ancestors will be determined.- Returns:
- a deque of the tree item's ancestors.
-
appendTreeitem
Description copied from interface:TreePopulator- Specified by:
appendTreeitemin interfaceTreePopulator- 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
public IntegrationObjectDefinition populateTree(org.zkoss.zul.Treeitem parent, IntegrationObjectDefinition existingDefinitions, IntegrationObjectDefinition currentAttributesMap, Set<SubtypeData> subtypeDataSet) Populates a tree iteratively.The method will collect all the
AttributeDescriptorModelof aComposedTypeModelincluding those wrapped in collection type, generate a set ofTreeNodeDatafrom them and create a set ofTreeitemunder the parent Treeitem.- Specified by:
populateTreein interfaceTreePopulator- 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
public void populateTreeSelectedMode(org.zkoss.zul.Treeitem parent, IntegrationObjectDefinition existingDefinitions, Set<SubtypeData> subtypeDataSet) Description copied from interface:TreePopulatorPopulates a tree iteratively, but only with selectedAbstractListItemDTO.- Specified by:
populateTreeSelectedModein interfaceTreePopulator- 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.
-
setAncestors
Description copied from interface:TreePopulatorSet the ancestors. For any tree node, the populator will not create child tree nodes that is an ancestor.- Specified by:
setAncestorsin interfaceTreePopulator- Parameters:
ancestors- the deque of ancestors.
-
resetState
public void resetState()Description copied from interface:TreePopulatorReset class state by clearing the deque of ancestors.- Specified by:
resetStatein interfaceTreePopulator
-
addAncestor
Description copied from interface:TreePopulatorAdd a key at the end of the ancestors deque.- Specified by:
addAncestorin interfaceTreePopulator- Parameters:
integrationMapKeyDTO- the key to be added to the ancestors deque.
-