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 org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
21 import org.kuali.rice.krad.datadictionary.parse.BeanTags;
22
23 import java.util.ArrayList;
24 import java.util.List;
25
26
27
28
29
30
31
32
33 @BeanTags({@BeanTag(name = "verticalCheckboxesControl-bean", parent = "Uif-VerticalCheckboxesControl"),
34 @BeanTag(name = "horizontalCheckboxesControl-bean", parent = "Uif-HorizontalCheckboxesControl")})
35 public class CheckboxGroupControl extends MultiValueControlBase {
36 private static final long serialVersionUID = 8800478332086081970L;
37
38 private String delimiter;
39
40 private List<String> fieldsetClasses;
41
42 public CheckboxGroupControl() {
43 super();
44 fieldsetClasses = new ArrayList<String>();
45 }
46
47
48
49
50
51
52
53
54
55
56 @BeanTagAttribute(name = "delimiter")
57 public String getDelimiter() {
58 return this.delimiter;
59 }
60
61
62
63
64
65
66 public void setDelimiter(String delimiter) {
67 this.delimiter = delimiter;
68 }
69
70
71
72
73
74
75 @BeanTagAttribute(name = "fieldsetClasses", type = BeanTagAttribute.AttributeType.LISTVALUE)
76 public List<String> getFieldsetClasses() {
77 return fieldsetClasses;
78 }
79
80
81
82
83
84
85 public void setFieldsetClasses(List<String> fieldsetClasses) {
86 this.fieldsetClasses = fieldsetClasses;
87 }
88
89
90
91
92
93
94
95 public String getFieldsetClassesAsString() {
96 if (fieldsetClasses != null) {
97 return StringUtils.join(fieldsetClasses, " ");
98 }
99
100 return "";
101 }
102
103
104
105
106 @Override
107 protected <T> void copyProperties(T component) {
108 super.copyProperties(component);
109 CheckboxGroupControl checkboxGroupControlCopy = (CheckboxGroupControl) component;
110 checkboxGroupControlCopy.setDelimiter(this.delimiter);
111
112 if(fieldsetClasses != null) {
113 checkboxGroupControlCopy.setFieldsetClasses(new ArrayList<String>(this.fieldsetClasses));
114 }
115 }
116 }