View Javadoc
1   /**
2    * Copyright 2005-2014 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 KNS Struts deprecated, use KRAD and the Spring MVC framework.
25   */
26  @Deprecated
27  public class Row implements java.io.Serializable {
28  
29      private static final long serialVersionUID = 5920833652172097098L;
30      private List<Field> fields;
31      private boolean hidden;
32  
33      public Row() {
34          fields = new ArrayList<Field>();
35          hidden = false;
36      }
37  
38      public Row(List<Field> fields) {
39          this.fields = fields;
40          hidden = false;
41      }
42  
43      public Row(Field field) {
44          this.fields = new ArrayList<Field>();
45          fields.add(field);
46          hidden = false;
47      }
48  
49      /**
50       * @return the fields contained in the row
51       */
52      public List<Field> getFields() {
53          return fields;
54      }
55  
56      /**
57       * @param fields the fields to be displayed in the row.
58       */
59      public void setFields(List<Field> fields) {
60          this.fields = fields;
61      }
62  
63      /**
64       * @return the hidden
65       */
66      public boolean isHidden() {
67          return hidden;
68      }
69  
70      /**
71       * @param hidden the hidden to set
72       */
73      public void setHidden(boolean hidden) {
74          this.hidden = hidden;
75      }
76  
77      public Field getField(int index) {
78          while (fields.size() <= index) {
79              Field field = new Field();
80              fields.add(field);
81          }
82          return (Field) fields.get(index);
83      }
84  
85      public String toString(){
86      	StringBuffer sRet = new StringBuffer();
87      	sRet.append("[");
88  
89      	if(fields != null){
90      		for(Field f: fields){
91      			sRet.append(f.getPropertyName() + ", ");
92      		}
93  
94      		sRet.delete(sRet.length()-2, sRet.length());
95      	}
96      	sRet.append("]");
97  
98      	return sRet.toString();
99  
100     }
101 }