1 4 41 42 package org.apache.cocoon.faces.samples.carstore; 43 44 import javax.faces.context.FacesContext; 45 import javax.faces.model.SelectItem; 46 47 import java.util.ArrayList ; 48 import java.util.Collection ; 49 import java.util.ResourceBundle ; 50 51 public class CustomerBean extends Object { 52 53 54 String firstName = null; 55 String middleInitial = null; 56 String lastName = null; 57 String mailingAddress = null; 58 String city = null; 59 String state = null; 60 String zip = null; 61 String month = null; 62 String year = null; 63 64 65 public CustomerBean() { 66 super(); 67 } 68 69 70 protected Collection titleOptions = null; 71 72 73 public Collection getTitleOptions() { 74 titleOptions = new ArrayList (); 75 ResourceBundle rb = ResourceBundle.getBundle( 76 "org.apache.cocoon.faces.samples.carstore.bundles.Resources", 77 (FacesContext.getCurrentInstance().getViewRoot().getLocale())); 78 String titleStr = (String ) rb.getObject("mrLabel"); 79 titleOptions.add(new SelectItem(titleStr, titleStr, 80 titleStr)); 81 titleStr = (String ) rb.getObject("mrsLabel"); 82 titleOptions.add(new SelectItem(titleStr, titleStr, 83 titleStr)); 84 titleStr = (String ) rb.getObject("msLabel"); 85 titleOptions.add(new SelectItem(titleStr, titleStr, 86 titleStr)); 87 88 return titleOptions; 89 } 90 91 92 public void setTitleOptions(Collection newOptions) { 93 titleOptions = new ArrayList (newOptions); 94 } 95 96 97 String title = null; 98 99 100 public void setCurrentTitle(String newTitle) { 101 title = newTitle; 102 } 103 104 105 public String getCurrentTitle() { 106 return title; 107 } 108 109 110 public void setFirstName(String first) { 111 firstName = first; 112 } 113 114 115 public String getFirstName() { 116 return firstName; 117 } 118 119 120 public void setMiddleInitial(String mI) { 121 middleInitial = mI; 122 } 123 124 125 public String getMiddleInitial() { 126 return middleInitial; 127 } 128 129 130 public void setLastName(String last) { 131 lastName = last; 132 } 133 134 135 public String getLastName() { 136 return lastName; 137 } 138 139 140 public void setMailingAddress(String mA) { 141 mailingAddress = mA; 142 } 143 144 145 public String getMailingAddress() { 146 return mailingAddress; 147 } 148 149 150 public void setCity(String cty) { 151 city = cty; 152 } 153 154 155 public String getCity() { 156 return city; 157 } 158 159 160 public void setState(String sT) { 161 state = sT; 162 } 163 164 165 public String getState() { 166 return state; 167 } 168 169 170 public void setZip(String zipCode) { 171 zip = zipCode; 172 } 173 174 175 public String getZip() { 176 return zip; 177 } 178 179 180 public void setMonth(String mth) { 181 month = mth; 182 } 183 184 185 public String getMonth() { 186 return month; 187 } 188 189 190 public void setYear(String yr) { 191 year = yr; 192 } 193 194 195 public String getYear() { 196 return year; 197 } 198 } 199 | Popular Tags |