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