KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > faces > component > UISelectItems


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 javax.faces.component;
17
18 import javax.faces.context.FacesContext;
19 import javax.faces.el.ValueBinding;
20
21 /**
22  * see Javadoc of JSF Specification
23  *
24  * @author Manfred Geiler (latest modification by $Author: mwessendorf $)
25  * @version $Revision: 1.5 $ $Date: 2004/07/01 22:00:49 $
26  */

27 public class UISelectItems
28         extends UIComponentBase
29 {
30     //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
31

32     public static final String JavaDoc COMPONENT_TYPE = "javax.faces.SelectItems";
33     public static final String JavaDoc COMPONENT_FAMILY = "javax.faces.SelectItems";
34
35     private Object JavaDoc _value = null;
36
37     public UISelectItems()
38     {
39     }
40
41     public String JavaDoc getFamily()
42     {
43         return COMPONENT_FAMILY;
44     }
45
46     public void setValue(Object JavaDoc value)
47     {
48         _value = value;
49     }
50
51     public Object JavaDoc getValue()
52     {
53         if (_value != null) return _value;
54         ValueBinding vb = getValueBinding("value");
55         return vb != null ? (Object JavaDoc)vb.getValue(getFacesContext()) : null;
56     }
57
58
59     public Object JavaDoc saveState(FacesContext context)
60     {
61         Object JavaDoc values[] = new Object JavaDoc[2];
62         values[0] = super.saveState(context);
63         values[1] = _value;
64         return ((Object JavaDoc) (values));
65     }
66
67     public void restoreState(FacesContext context, Object JavaDoc state)
68     {
69         Object JavaDoc values[] = (Object JavaDoc[])state;
70         super.restoreState(context, values[0]);
71         _value = (Object JavaDoc)values[1];
72     }
73     //------------------ GENERATED CODE END ---------------------------------------
74
}
75
Popular Tags