1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.control;
17
18 import java.util.List;
19
20 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
21 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
22 import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
23 import org.kuali.rice.krad.uif.component.Component;
24 import org.kuali.rice.krad.uif.element.Message;
25 import org.kuali.rice.krad.uif.util.ComponentFactory;
26 import org.kuali.rice.krad.uif.util.ComponentUtils;
27 import org.kuali.rice.krad.uif.util.LifecycleElement;
28
29
30
31
32
33
34
35 @BeanTag(name = "checkboxControl-bean", parent = "Uif-CheckboxControl")
36 public class CheckboxControl extends ControlBase implements ValueConfiguredControl {
37 private static final long serialVersionUID = -1397028958569144230L;
38
39 private String value;
40 private String checkboxLabel;
41 private boolean checked;
42
43 private Message richLabelMessage;
44 private List<Component> inlineComponents;
45
46 public CheckboxControl() {
47 super();
48 }
49
50
51
52
53
54
55 @Override
56 public void performApplyModel(Object model, LifecycleElement parent) {
57 super.performApplyModel(model, parent);
58
59 if (richLabelMessage == null) {
60 Message message = ComponentFactory.getMessage();
61 message.setMessageText(checkboxLabel);
62 message.setInlineComponents(inlineComponents);
63 message.setRenderWrapperTag(false);
64 this.setRichLabelMessage(message);
65 }
66 }
67
68
69
70
71
72
73
74
75
76
77
78
79 @BeanTagAttribute(name="value")
80 public String getValue() {
81 return value;
82 }
83
84
85
86
87
88
89 public void setValue(String value) {
90 this.value = value;
91 }
92
93
94
95
96
97
98 @BeanTagAttribute(name="checkboxLabel")
99 public String getCheckboxLabel() {
100 return checkboxLabel;
101 }
102
103
104
105
106
107
108 public void setCheckboxLabel(String checkboxLabel) {
109 this.checkboxLabel = checkboxLabel;
110 }
111
112
113
114
115
116
117 public void setChecked(boolean checked) {
118 this.checked = checked;
119 }
120
121
122
123
124
125 public boolean isChecked() {
126 return checked;
127 }
128
129
130
131
132
133
134
135
136 @BeanTagAttribute(name="richLabelMessage",type= BeanTagAttribute.AttributeType.SINGLEBEAN)
137 public Message getRichLabelMessage() {
138 return richLabelMessage;
139 }
140
141
142
143
144
145
146
147
148 public void setRichLabelMessage(Message richLabelMessage) {
149 this.richLabelMessage = richLabelMessage;
150 }
151
152
153
154
155
156
157 @BeanTagAttribute(name="inlineComponents",type= BeanTagAttribute.AttributeType.LISTBEAN)
158 public List<Component> getInlineComponents() {
159 return inlineComponents;
160 }
161
162
163
164
165
166
167 public void setInlineComponents(List<Component> inlineComponents) {
168 this.inlineComponents = inlineComponents;
169 }
170
171
172
173
174 @Override
175 public void completeValidation(ValidationTrace tracer){
176 tracer.addBean(this);
177
178 super.completeValidation(tracer.getCopy());
179 }
180 }