1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.document.web;
17
18 import javax.servlet.jsp.JspException;
19 import javax.servlet.jsp.PageContext;
20 import javax.servlet.jsp.tagext.Tag;
21
22 import org.apache.commons.lang.StringUtils;
23 import org.kuali.ole.sys.document.web.renderers.LabelRenderer;
24
25
26
27
28 public class FieldHeaderLabel extends HeaderLabel {
29 private HeaderLabelPopulating headerLabelPopulator;
30 private String label;
31 private boolean readOnly = false;
32 private boolean required = false;
33 private String labelFor;
34 private String fullClassNameForHelp;
35 private String attributeEntryForHelp;
36
37
38
39
40
41 public FieldHeaderLabel(HeaderLabelPopulating headerLabelPopulator) {
42 this.headerLabelPopulator = headerLabelPopulator;
43 }
44
45
46
47
48
49 public String getAttributeEntryForHelp() {
50 return attributeEntryForHelp;
51 }
52
53
54
55
56
57 public void setAttributeEntryForHelp(String attributeEntryForHelp) {
58 this.attributeEntryForHelp = attributeEntryForHelp;
59 }
60
61
62
63
64
65 public String getFullClassNameForHelp() {
66 return fullClassNameForHelp;
67 }
68
69
70
71
72
73 public void setFullClassNameForHelp(String fullClassNameForHelp) {
74 this.fullClassNameForHelp = fullClassNameForHelp;
75 }
76
77
78
79
80
81 public String getLabel() {
82 return label;
83 }
84
85
86
87
88
89 public void setLabel(String label) {
90 this.label = label;
91 }
92
93
94
95
96
97 public String getLabelFor() {
98 return labelFor;
99 }
100
101
102
103
104
105 public void setLabelFor(String labelFor) {
106 this.labelFor = labelFor;
107 }
108
109
110
111
112
113 public boolean isReadOnly() {
114 return readOnly;
115 }
116
117
118
119
120
121 public void setReadOnly(boolean readOnly) {
122 this.readOnly = readOnly;
123 }
124
125
126
127
128
129 public boolean isRequired() {
130 return required;
131 }
132
133
134
135
136
137 public void setRequired(boolean required) {
138 this.required = required;
139 }
140
141
142
143
144 public void renderElement(PageContext pageContext, Tag parentTag, AccountingLineRenderingContext renderingContext) throws JspException {
145 headerLabelPopulator.populateHeaderLabel(this, renderingContext);
146 LabelRenderer renderer = new LabelRenderer();
147 renderer.setLabel(label);
148 renderer.setRequired(required);
149 renderer.setReadOnly(readOnly);
150 renderer.setLabelFor(labelFor);
151 if (!StringUtils.isBlank(fullClassNameForHelp)) {
152 renderer.setFullClassNameForHelp(fullClassNameForHelp);
153 }
154 if (!StringUtils.isBlank(attributeEntryForHelp)) {
155 renderer.setAttributeEntryForHelp(attributeEntryForHelp);
156 }
157 renderer.render(pageContext, parentTag);
158 renderer.clear();
159 }
160
161 }