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