001: /*
002: * $Id: CustomerBean.java 53793 2004-10-05 13:47:48Z vgritsenko $
003: */
004: /*
005: * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
006: *
007: * Redistribution and use in source and binary forms, with or
008: * without modification, are permitted provided that the following
009: * conditions are met:
010: *
011: * - Redistributions of source code must retain the above copyright
012: * notice, this list of conditions and the following disclaimer.
013: *
014: * - Redistribution in binary form must reproduce the above
015: * copyright notice, this list of conditions and the following
016: * disclaimer in the documentation and/or other materials
017: * provided with the distribution.
018: *
019: * Neither the name of Sun Microsystems, Inc. or the names of
020: * contributors may be used to endorse or promote products derived
021: * from this software without specific prior written permission.
022: *
023: * This software is provided "AS IS," without a warranty of any
024: * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
025: * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
026: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
027: * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
028: * DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT OF OR
029: * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE OR
030: * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE
031: * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT,
032: * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
033: * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF
034: * THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
035: * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
036: *
037: * You acknowledge that this software is not designed, licensed or
038: * intended for use in the design, construction, operation or
039: * maintenance of any nuclear facility.
040: */
041:
042: package org.apache.cocoon.faces.samples.carstore;
043:
044: import javax.faces.context.FacesContext;
045: import javax.faces.model.SelectItem;
046:
047: import java.util.ArrayList;
048: import java.util.Collection;
049: import java.util.ResourceBundle;
050:
051: public class CustomerBean extends Object {
052:
053: String firstName = null;
054: String middleInitial = null;
055: String lastName = null;
056: String mailingAddress = null;
057: String city = null;
058: String state = null;
059: String zip = null;
060: String month = null;
061: String year = null;
062:
063: public CustomerBean() {
064: super ();
065: }
066:
067: protected Collection titleOptions = null;
068:
069: public Collection getTitleOptions() {
070: titleOptions = new ArrayList();
071: ResourceBundle rb = ResourceBundle
072: .getBundle(
073: "org.apache.cocoon.faces.samples.carstore.bundles.Resources",
074: (FacesContext.getCurrentInstance()
075: .getViewRoot().getLocale()));
076: String titleStr = (String) rb.getObject("mrLabel");
077: titleOptions.add(new SelectItem(titleStr, titleStr, titleStr));
078: titleStr = (String) rb.getObject("mrsLabel");
079: titleOptions.add(new SelectItem(titleStr, titleStr, titleStr));
080: titleStr = (String) rb.getObject("msLabel");
081: titleOptions.add(new SelectItem(titleStr, titleStr, titleStr));
082:
083: return titleOptions;
084: }
085:
086: public void setTitleOptions(Collection newOptions) {
087: titleOptions = new ArrayList(newOptions);
088: }
089:
090: String title = null;
091:
092: public void setCurrentTitle(String newTitle) {
093: title = newTitle;
094: }
095:
096: public String getCurrentTitle() {
097: return title;
098: }
099:
100: public void setFirstName(String first) {
101: firstName = first;
102: }
103:
104: public String getFirstName() {
105: return firstName;
106: }
107:
108: public void setMiddleInitial(String mI) {
109: middleInitial = mI;
110: }
111:
112: public String getMiddleInitial() {
113: return middleInitial;
114: }
115:
116: public void setLastName(String last) {
117: lastName = last;
118: }
119:
120: public String getLastName() {
121: return lastName;
122: }
123:
124: public void setMailingAddress(String mA) {
125: mailingAddress = mA;
126: }
127:
128: public String getMailingAddress() {
129: return mailingAddress;
130: }
131:
132: public void setCity(String cty) {
133: city = cty;
134: }
135:
136: public String getCity() {
137: return city;
138: }
139:
140: public void setState(String sT) {
141: state = sT;
142: }
143:
144: public String getState() {
145: return state;
146: }
147:
148: public void setZip(String zipCode) {
149: zip = zipCode;
150: }
151:
152: public String getZip() {
153: return zip;
154: }
155:
156: public void setMonth(String mth) {
157: month = mth;
158: }
159:
160: public String getMonth() {
161: return month;
162: }
163:
164: public void setYear(String yr) {
165: year = yr;
166: }
167:
168: public String getYear() {
169: return year;
170: }
171: }
|