Class TreeGroup

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, DataBinding, Ordered, ScriptEventSupport, Container, Group, LifecycleElement, Helpable, org.springframework.core.Ordered

public class TreeGroup extends GroupBase implements DataBinding
Group component that is backed by a Tree data structure and typically rendered as a tree in the user interface
Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • TreeGroup

      public TreeGroup()
  • Method Details

    • performInitialization

      public void performInitialization(Object model)
      The following actions are performed:
      • Set fieldBindModelPath to the collection model path (since the fields have to belong to the same model as the collection)
      • Set defaults for binding
      • Calls view helper service to initialize prototypes
      Specified by:
      performInitialization in interface LifecycleElement
      Overrides:
      performInitialization in class GroupBase
      Parameters:
      model - - object instance containing the view data
      See Also:
    • performApplyModel

      public void performApplyModel(Object model, LifecycleElement parent)
      Description copied from class: ContainerBase
      The following updates are done here:
      • Evaluate the progressive render condition (if set) and combine with the current render status to set the render status
      Called after the initialize phase to perform conditional logic based on the model data

      Where components can perform conditional logic such as dynamically generating new fields or setting field state based on the given data

      Specified by:
      performApplyModel in interface LifecycleElement
      Overrides:
      performApplyModel in class ContainerBase
      Parameters:
      model - - Top level object containing the data (could be the form or a top level business object, dto)
      parent - parent lifecycle element
    • buildTreeGroups

      protected void buildTreeGroups(Object model)
      Builds the components that will be rendered as part of the tree group

      The component tree group mirrors the tree data structure on the model. For each node of the data structure, a corresponding Message will be created for the node label, and a Group component for the node data. These are placed into a new node for the component tree. After the tree is built it is set as a property on the tree group to be read by the renderer

      Parameters:
      model - object containing the view data from which the tree data will be retrieved
    • buildTreeNode

      protected Node<Group,Message> buildTreeNode(Node<Object,String> nodeData, String bindingPrefix, String parentNode)
    • getNodeComponents

      public List<Component> getNodeComponents()
      Gets all node components within the tree.
      Returns:
      list of node components
    • getComponentPrototypes

      @ViewLifecycleRestriction("INITIALIZE") public List<Component> getComponentPrototypes()
      Gets all node components prototypes within the tree.
      Returns:
      list of node component prototypes
    • addNodeComponents

      protected void addNodeComponents(Node<Group,Message> node, List<Component> components)
      Retrieves the Component instances from the node for building the nested components list
      Parameters:
      node - node to pull components from
      components - list to add components to
    • getPropertyName

      public String getPropertyName()
      Description copied from interface: DataBinding
      Name of the property (relative to the parent object) the component binds to
      Specified by:
      getPropertyName in interface DataBinding
      Returns:
      String property name
    • setPropertyName

      public void setPropertyName(String propertyName)
    • getBindingInfo

      public BindingInfo getBindingInfo()
      Description copied from interface: DataBinding
      Returns the BindingInfo instance that is configured for the component
      Specified by:
      getBindingInfo in interface DataBinding
      Returns:
      BindingInfo
      See Also:
    • setBindingInfo

      public void setBindingInfo(BindingInfo bindingInfo)
      Description copied from interface: DataBinding
      Setter for the binding info instance
      Specified by:
      setBindingInfo in interface DataBinding
      Parameters:
      bindingInfo -
    • getDefaultNodePrototype

      public NodePrototype getDefaultNodePrototype()
      Returns:
      the defaultNodePrototype
    • setDefaultNodePrototype

      public void setDefaultNodePrototype(NodePrototype defaultNodePrototype)
      Parameters:
      defaultNodePrototype - the defaultNodePrototype to set
    • getNodePrototypeMap

      public Map<Class<?>,NodePrototype> getNodePrototypeMap()
      Returns:
      the nodePrototypeMap
    • setNodePrototypeMap

      public void setNodePrototypeMap(Map<Class<?>,NodePrototype> nodePrototypeMap)
      Parameters:
      nodePrototypeMap - the nodePrototypeMap to set
    • getTreeGroups

      public Tree<Group,Message> getTreeGroups()
    • setTreeGroups

      public void setTreeGroups(Tree<Group,Message> treeGroups)
    • getTree

      public Tree getTree()
    • setTree

      public void setTree(Tree tree)
    • copyNode

      protected Node<Group,Message> copyNode(Node<Group,Message> node)
      Copies a Node instance and then recursively copies each of its child nodes
      Parameters:
      node - node instance to copy
      Returns:
      new node instance copied from given node