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 Details

    • determineTreeitemAncestors

      Deque<IntegrationMapKeyDTO> determineTreeitemAncestors(org.zkoss.zul.Treeitem treeitem)
      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

      org.zkoss.zul.Treeitem appendTreeitem(org.zkoss.zul.Treeitem parent, TreeNodeData tnd)
      Creates a Treeitem with a given TreeNodeData and adds it as a child of a given parent Treeitem.
      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 selected AbstractListItemDTO.
      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

      void setAncestors(Deque<IntegrationMapKeyDTO> ancestors)
      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

      void addAncestor(IntegrationMapKeyDTO integrationMapKeyDTO)
      Add a key at the end of the ancestors deque.
      Parameters:
      integrationMapKeyDTO - the key to be added to the ancestors deque.