1 18 19 package org.apache.struts.webapp.tiles.dynPortal; 20 21 import java.util.ArrayList ; 22 import java.util.List ; 23 24 import org.apache.struts.action.ActionForm; 25 26 27 29 30 public final class PortalPrefsForm extends ActionForm { 31 32 33 protected String validate; 34 35 protected String [] empty = {}; 36 37 protected String [] remaining = empty; 38 39 protected List columns = new ArrayList (); 40 41 protected List columnLabels = new ArrayList (); 42 43 protected List newCols = new ArrayList (); 44 45 46 protected List choice; 47 48 protected List choiceLabels; 49 50 protected boolean initialized = false; 51 52 53 56 public void setCol( int index, List col ) 57 { 58 columns.set( index, col); 59 } 60 61 64 public void addCol( List col ) 65 { 66 columns.add( col); 67 } 68 69 72 public List getColLabels(int index) 73 { 74 return (List )columnLabels.get(index); 75 } 76 77 80 public void setColLabels( int index, List col ) 81 { 82 columnLabels.set( index, col); 83 } 84 85 88 public void addColLabels( List col ) 89 { 90 columnLabels.add( col); 91 } 92 93 96 public List getCol(int index) 97 { 98 return (List )columns.get(index); 99 } 100 101 104 public void setNewCol( int index, String list[] ) 105 { 106 while( index>=newCols.size())newCols.add(null); 108 newCols.set( index, list); 109 } 110 111 114 public String [] getNewCol(int index) 115 { 116 if(newCols==null || index>=newCols.size()) 117 return null; 118 return (String [])newCols.get(index); 119 } 120 121 124 public int getNumCol() 125 { 126 return newCols.size(); 127 } 128 129 132 public void setL1( String array[] ) 133 { 134 setNewCol(1, array); 135 } 136 139 public String [] getL1() 140 { 141 return getNewCol(1); 142 } 143 144 147 public void setL0( String array[] ) 148 { 149 setNewCol(0, array); 150 } 151 154 public String [] getL0() 155 { 156 return getNewCol(0); 157 } 158 161 public void setRemaining( String array[] ) 162 { 163 remaining = array; 164 } 165 168 public String [] getRemaining() 169 { 170 return remaining; 171 } 172 173 174 177 public void setChoices( List list ) 178 { 179 choice = list; 180 } 181 184 public void setChoiceLabels( List list ) 185 { 186 choiceLabels = list; 187 } 188 191 public List getChoices() 192 { 193 return choice; 194 } 195 198 public List getChoiceLabels() 199 { 200 return choiceLabels; 201 } 202 203 206 public boolean isSubmitted() 207 { 208 return validate != null; 209 } 210 211 214 public void setValidate( String value) 215 { 216 this.validate = value; 217 } 218 219 222 public void reset() 223 { 224 remaining = empty; 225 validate = null; 226 columns.clear(); 227 columnLabels.clear(); 228 newCols.clear(); 229 } 230 233 public boolean isInitialized() 234 { 235 return initialized; 236 } 237 240 public void setInitialized( boolean isInitialized) 241 { 242 initialized = isInitialized; 243 } 244 } 245 246 | Popular Tags |