1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krms.util;
17
18 import org.kuali.rice.core.api.util.tree.Node;
19 import org.kuali.rice.core.api.util.tree.Tree;
20 import org.kuali.rice.krad.uif.container.Group;
21 import org.kuali.rice.krad.uif.container.TreeGroup;
22 import org.kuali.rice.krad.uif.element.Message;
23 import org.kuali.rice.krad.uif.util.ObjectPropertyUtils;
24 import org.kuali.rice.krad.uif.view.View;
25
26
27
28
29 public class ViewTreeGroup extends TreeGroup {
30
31 protected void buildTreeGroups(View view, Object model) {
32
33 Tree<Object, String> treeData = ObjectPropertyUtils.getPropertyValue(model, getBindingInfo().getBindingPath());
34
35 if (treeData == null) {
36 return;
37 }
38
39
40 Tree<Group, Message> treeGroups = new Tree<Group, Message>();
41
42 String bindingPrefix = getBindingInfo().getBindingPrefixForNested();
43 Node<Group, Message> rootNode = buildTreeNode(treeData.getRootElement(),
44 bindingPrefix + ".rootElement", "root");
45 treeGroups.setRootElement(rootNode);
46
47 setTreeGroups(treeGroups);
48 }
49 }