001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kns.web.ui;
017
018import java.util.ArrayList;
019import java.util.List;
020
021/**
022 * This class represents a row of fields on the ui.
023 */
024@Deprecated
025public class Row implements java.io.Serializable {
026
027    private static final long serialVersionUID = 5920833652172097098L;
028    private List<Field> fields;
029    private boolean hidden;
030
031    public Row() {
032        fields = new ArrayList<Field>();
033        hidden = false;
034    }
035
036    public Row(List<Field> fields) {
037        this.fields = fields;
038        hidden = false;
039    }
040
041    public Row(Field field) {
042        this.fields = new ArrayList<Field>();
043        fields.add(field);
044        hidden = false;
045    }
046
047    /**
048     * @return the fields contained in the row
049     */
050    public List<Field> getFields() {
051        return fields;
052    }
053
054    /**
055     * @param fields the fields to be displayed in the row.
056     */
057    public void setFields(List<Field> fields) {
058        this.fields = fields;
059    }
060
061    /**
062     * @return the hidden
063     */
064    public boolean isHidden() {
065        return hidden;
066    }
067
068    /**
069     * @param hidden the hidden to set
070     */
071    public void setHidden(boolean hidden) {
072        this.hidden = hidden;
073    }
074
075    public Field getField(int index) {
076        while (fields.size() <= index) {
077            Field field = new Field();
078            fields.add(field);
079        }
080        return (Field) fields.get(index);
081    }
082
083    public String toString(){
084        StringBuffer sRet = new StringBuffer();
085        sRet.append("[");
086
087        if(fields != null){
088                for(Field f: fields){
089                        sRet.append(f.getPropertyName() + ", ");
090                }
091
092                sRet.delete(sRet.length()-2, sRet.length());
093        }
094        sRet.append("]");
095
096        return sRet.toString();
097
098    }
099}