1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.web.ui;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21
22
23
24
25
26 @Deprecated
27 public class Section implements java.io.Serializable {
28 private static final long serialVersionUID = 390440643941774650L;
29 String sectionTitle;
30 String sectionId;
31 String errorKey = "";
32 int numberOfColumns;
33 boolean isCollapsible = true;
34 String extraButtonSource;
35 boolean hidden = false;
36 boolean readOnly = false;
37 String helpUrl="";
38
39 boolean defaultOpen = true;
40
41 Class sectionClass;
42 List<Row> rows;
43 List<String> containedCollectionNames = new ArrayList();
44
45
46
47
48 public Section() {
49 }
50
51
52
53
54
55
56 public Section(List rows) {
57 this.rows = rows;
58 }
59
60
61
62
63
64 public String getErrorKey() {
65 return errorKey;
66 }
67
68
69
70
71
72 public void setErrorKey(String errorKey) {
73 this.errorKey = errorKey;
74 }
75
76
77
78
79
80 public List<Row> getRows() {
81 return rows;
82 }
83
84
85
86
87
88 public void setRows(List<Row> rows) {
89 this.rows = rows;
90 }
91
92
93
94
95
96 public String getSectionTitle() {
97 return sectionTitle;
98 }
99
100
101
102
103
104 public void setSectionTitle(String sectionTitle) {
105 this.sectionTitle = sectionTitle;
106 }
107
108
109
110
111
112 public boolean isCollapsible() {
113 return isCollapsible;
114 }
115
116
117
118
119
120 public void setCollapsible(boolean isCollapsible) {
121 this.isCollapsible = isCollapsible;
122 }
123
124
125
126
127
128 public Class getSectionClass() {
129 return sectionClass;
130 }
131
132
133
134
135
136 public void setSectionClass(Class sectionClass) {
137 this.sectionClass = sectionClass;
138 }
139
140
141 public int getNumberOfColumns() {
142 if (numberOfColumns != 0) {
143 return numberOfColumns;
144 } else {
145
146 return 1;
147 }
148 }
149
150 public void setNumberOfColumns(int numberOfColumns) {
151 this.numberOfColumns = numberOfColumns;
152 }
153
154
155
156
157
158
159 public List<String> getContainedCollectionNames() {
160 return containedCollectionNames;
161 }
162
163
164
165
166
167 public void setContainedCollectionNames(List<String> containedCollectionNames) {
168 this.containedCollectionNames = containedCollectionNames;
169 }
170
171
172
173
174 public String getExtraButtonSource() {
175 return extraButtonSource;
176 }
177
178
179
180
181 public void setExtraButtonSource(String extraButtonSource) {
182 this.extraButtonSource = extraButtonSource;
183 }
184
185
186
187
188 public int getFieldCnt() {
189 if (rows != null && !rows.isEmpty()) {
190 Row firstRow = rows.get(0);
191 List<Field> rowFields = firstRow.getFields();
192 Field firstElement = rowFields.get(0);
193
194 if (Field.CONTAINER.equals(firstElement.getFieldType())) {
195 if (firstElement.getContainerRows().size() > 0) {
196 rowFields = firstElement.getContainerRows().get(0).getFields();
197 }
198 }
199 if (rowFields.size() == 1) {
200 int i = 1;
201 while (i < rows.size() &&(Field.SUB_SECTION_SEPARATOR.equals(firstElement.getFieldType()) ||
202 Field.HIDDEN.equals(firstElement.getFieldType()))) {
203 Row aRow = rows.get(i);
204 rowFields = aRow.getFields();
205 firstElement = rowFields.get(0);
206 i++;
207 }
208 }
209 int cnt = 0;
210 for (Field element : rowFields ) {
211
212 if (!Field.IMAGE_SUBMIT.equals(element.getFieldType())) {
213 cnt += 2;
214 }
215 }
216 return cnt;
217 }
218 else {
219 return 0;
220 }
221 }
222
223 public String getSectionId() {
224 return this.sectionId;
225 }
226
227 public void setSectionId(String sectionId) {
228 this.sectionId = sectionId;
229 }
230
231 public boolean isHidden() {
232 return this.hidden;
233 }
234
235 public void setHidden(boolean hidden) {
236 this.hidden = hidden;
237 }
238
239
240
241
242 public boolean isReadOnly() {
243 return this.readOnly;
244 }
245
246
247
248
249 public void setReadOnly(boolean readOnly) {
250 this.readOnly = readOnly;
251 }
252
253
254
255
256 public boolean isDefaultOpen() {
257 return this.defaultOpen;
258 }
259
260
261
262
263 public void setDefaultOpen(boolean defaultOpen) {
264 this.defaultOpen = defaultOpen;
265 }
266
267 public String getHelpUrl() {
268 return helpUrl;
269 }
270
271 public void setHelpUrl(String helpUrl) {
272 this.helpUrl = helpUrl;
273 }
274
275 }