1 package org.kuali.rice.krad.uif.layout.extension;
2
3 import org.apache.commons.lang.StringUtils;
4 import org.kuali.rice.krad.uif.container.Group;
5 import org.kuali.rice.krad.uif.layout.StackedLayoutManagerBase;
6 import org.kuali.rice.krad.uif.util.ObjectPropertyUtils;
7
8
9
10
11
12
13 public class TabbedLayoutManager extends StackedLayoutManagerBase {
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 @Override
37 protected String buildLineHeaderText(Object line, Group lineGroup) {
38
39
40
41
42
43
44
45
46
47
48 StringBuilder summaryFieldString = new StringBuilder("");
49 for (String summaryField : getSummaryFields()) {
50 Object summaryFieldValue = ObjectPropertyUtils.getPropertyValue(
51 line, summaryField);
52 if (StringUtils.isNotBlank(summaryFieldString.toString())) {
53 summaryFieldString.append(" - ");
54 }
55
56 if (summaryFieldValue != null) {
57 summaryFieldString.append(summaryFieldValue);
58 } else {
59 summaryFieldString.append("Null");
60 }
61 }
62
63 String headerText = getSummaryTitle();
64 if (StringUtils.isNotBlank(headerText)
65 && StringUtils.isNotBlank(summaryFieldString.toString())) {
66 headerText += " ( " + summaryFieldString + " )";
67 } else if (StringUtils.isNotBlank(summaryFieldString.toString())) {
68 headerText = summaryFieldString.toString();
69 }
70
71 return headerText;
72 }
73 }