KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > web > ui > common > component > UIImagePicker


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.web.ui.common.component;
18
19 import javax.faces.component.UIInput;
20 import javax.faces.context.FacesContext;
21
22 import org.apache.commons.logging.Log;
23 import org.apache.commons.logging.LogFactory;
24
25 /**
26  * Component to represent a selectable list of images
27  *
28  * @author gavinc
29  */

30 public class UIImagePicker extends UIInput
31 {
32    private static Log logger = LogFactory.getLog(UIImagePicker.class);
33    
34    /**
35     * Default constructor
36     */

37    public UIImagePicker()
38    {
39       // set the default renderer for an image picker component
40
setRendererType("org.alfresco.faces.Radio");
41    }
42    
43    /**
44     * @see javax.faces.component.UIComponent#getFamily()
45     */

46    public String JavaDoc getFamily()
47    {
48       return "org.alfresco.faces.ImagePicker";
49    }
50    
51    /**
52     * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext, java.lang.Object)
53     */

54    public void restoreState(FacesContext context, Object JavaDoc state)
55    {
56       Object JavaDoc values[] = (Object JavaDoc[])state;
57       // standard component attributes are restored by the super class
58
super.restoreState(context, values[0]);
59    }
60    
61    /**
62     * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
63     */

64    public Object JavaDoc saveState(FacesContext context)
65    {
66       Object JavaDoc values[] = new Object JavaDoc[1];
67       // standard component attributes are saved by the super class
68
values[0] = super.saveState(context);
69       return (values);
70    }
71 }
72
Popular Tags