java.lang.Object
de.hybris.platform.integrationbackoffice.widgets.modeling.builders.DefaultTreePopulator
All Implemented Interfaces:
TreePopulator

public class DefaultTreePopulator extends Object implements TreePopulator
Default implementation of TreePopulator.
  • Constructor Details

  • Method Details

    • determineTreeitemAncestors

      public Deque<IntegrationMapKeyDTO> determineTreeitemAncestors(org.zkoss.zul.Treeitem treeitem)
      Description copied from interface: TreePopulator
      Find all ancestors for a given tree item. The ancestors will be ordered from the root tree item to the given tree item.
      Specified by:
      determineTreeitemAncestors in interface TreePopulator
      Parameters:
      treeitem - the tree item for which its ancestors will be determined.
      Returns:
      a deque of the tree item's ancestors.
    • appendTreeitem

      public org.zkoss.zul.Treeitem appendTreeitem(org.zkoss.zul.Treeitem parent, TreeNodeData tnd)
      Description copied from interface: TreePopulator
      Creates a Treeitem with a given TreeNodeData and adds it as a child of a given parent Treeitem.
      Specified by:
      appendTreeitem in interface TreePopulator
      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 AttributeDescriptorModel of a ComposedTypeModel including those wrapped in collection type, generate a set of TreeNodeData from them and create a set of Treeitem under the parent Treeitem.

      Specified by:
      populateTree in interface TreePopulator
      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: TreePopulator
      Populates a tree iteratively, but only with selected AbstractListItemDTO.
      Specified by:
      populateTreeSelectedMode in interface TreePopulator
      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

      public void setAncestors(Deque<IntegrationMapKeyDTO> ancestors)
      Description copied from interface: TreePopulator
      Set the ancestors. For any tree node, the populator will not create child tree nodes that is an ancestor.
      Specified by:
      setAncestors in interface TreePopulator
      Parameters:
      ancestors - the deque of ancestors.
    • resetState

      public void resetState()
      Description copied from interface: TreePopulator
      Reset class state by clearing the deque of ancestors.
      Specified by:
      resetState in interface TreePopulator
    • addAncestor

      public void addAncestor(IntegrationMapKeyDTO integrationMapKeyDTO)
      Description copied from interface: TreePopulator
      Add a key at the end of the ancestors deque.
      Specified by:
      addAncestor in interface TreePopulator
      Parameters:
      integrationMapKeyDTO - the key to be added to the ancestors deque.