KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > examples > forceid > ForceIdBean


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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.apache.myfaces.examples.forceid;
17
18 import javax.faces.component.UISelectItem;
19 import java.util.ArrayList JavaDoc;
20
21 /**
22  * @author <a HREF="mailto:matzew@apache.org">Matthias Weßendorf</a>
23  */

24 public class ForceIdBean {
25     
26     private String JavaDoc valueOne, valueTwo;
27     private User users[];
28     private ArrayList JavaDoc choices = new ArrayList JavaDoc();
29     private String JavaDoc currentChoice;
30     
31     public ForceIdBean(){
32         users = new User[2];
33         users[0] = new User("MyFaces","secrect");
34         users[1] = new User("Tomcat","secrect");
35         
36         choices.add("foo");
37         choices.add("bar");
38         choices.add("buzz");
39     }
40
41     public String JavaDoc getValueOne() {
42         return valueOne;
43     }
44     public void setValueOne(String JavaDoc valueOne) {
45         this.valueOne = valueOne;
46     }
47     public String JavaDoc getValueTwo() {
48         return valueTwo;
49     }
50     public void setValueTwo(String JavaDoc valueTwo) {
51         this.valueTwo = valueTwo;
52     }
53     public User[] getUsers() {
54         return users;
55     }
56     public void setUsers(User[] users) {
57         this.users = users;
58     }
59     
60     public ArrayList JavaDoc getChoices()
61     {
62         return choices;
63     }
64     
65     public void setCurrentChoice(String JavaDoc currentChoice)
66     {
67         this.currentChoice = currentChoice;
68     }
69     
70     public String JavaDoc getCurrentChoice()
71     {
72         return currentChoice;
73     }
74 }
75
Popular Tags