Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Row |
|
| 1.3333333333333333;1.333 |
1 | /** | |
2 | * Copyright 2005-2011 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.kns.web.ui; | |
17 | ||
18 | import java.util.ArrayList; | |
19 | import java.util.List; | |
20 | ||
21 | /** | |
22 | * This class represents a row of fields on the ui. | |
23 | */ | |
24 | @Deprecated | |
25 | public class Row implements java.io.Serializable { | |
26 | ||
27 | private static final long serialVersionUID = 5920833652172097098L; | |
28 | private List<Field> fields; | |
29 | private boolean hidden; | |
30 | ||
31 | 0 | public Row() { |
32 | 0 | fields = new ArrayList<Field>(); |
33 | 0 | hidden = false; |
34 | 0 | } |
35 | ||
36 | 0 | public Row(List<Field> fields) { |
37 | 0 | this.fields = fields; |
38 | 0 | hidden = false; |
39 | 0 | } |
40 | ||
41 | 0 | public Row(Field field) { |
42 | 0 | this.fields = new ArrayList<Field>(); |
43 | 0 | fields.add(field); |
44 | 0 | hidden = false; |
45 | 0 | } |
46 | ||
47 | /** | |
48 | * @return the fields contained in the row | |
49 | */ | |
50 | public List<Field> getFields() { | |
51 | 0 | return fields; |
52 | } | |
53 | ||
54 | /** | |
55 | * @param fields the fields to be displayed in the row. | |
56 | */ | |
57 | public void setFields(List<Field> fields) { | |
58 | 0 | this.fields = fields; |
59 | 0 | } |
60 | ||
61 | /** | |
62 | * @return the hidden | |
63 | */ | |
64 | public boolean isHidden() { | |
65 | 0 | return hidden; |
66 | } | |
67 | ||
68 | /** | |
69 | * @param hidden the hidden to set | |
70 | */ | |
71 | public void setHidden(boolean hidden) { | |
72 | 0 | this.hidden = hidden; |
73 | 0 | } |
74 | ||
75 | public Field getField(int index) { | |
76 | 0 | while (fields.size() <= index) { |
77 | 0 | Field field = new Field(); |
78 | 0 | fields.add(field); |
79 | 0 | } |
80 | 0 | return (Field) fields.get(index); |
81 | } | |
82 | ||
83 | public String toString(){ | |
84 | 0 | StringBuffer sRet = new StringBuffer(); |
85 | 0 | sRet.append("["); |
86 | ||
87 | 0 | if(fields != null){ |
88 | 0 | for(Field f: fields){ |
89 | 0 | sRet.append(f.getPropertyName() + ", "); |
90 | } | |
91 | ||
92 | 0 | sRet.delete(sRet.length()-2, sRet.length()); |
93 | } | |
94 | 0 | sRet.append("]"); |
95 | ||
96 | 0 | return sRet.toString(); |
97 | ||
98 | } | |
99 | } |