KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > weather > component > UISelectList


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.portlets.weather.component;
6
7 import java.util.List JavaDoc;
8 import org.exoplatform.container.SessionContainer;
9 import org.exoplatform.container.client.http.HttpClientInfo;
10 import org.exoplatform.faces.core.component.UIInput;
11
12 public class UISelectList extends UIInput {
13
14     protected String JavaDoc value_ ;
15     private List JavaDoc options_ ;
16
17     public UISelectList(String JavaDoc name, String JavaDoc value, List JavaDoc options) {
18         super();
19         name_ = name ;
20         value_ = value;
21         options_ = options ;
22         setId(name) ;
23         
24     HttpClientInfo client =
25       (HttpClientInfo)SessionContainer.getInstance().getMonitor().getClientInfo();
26     String JavaDoc type = client.getClientType() ;
27     if (type.equals(HttpClientInfo.MOBILE_BROWSER_TYPE)) {
28       setRendererType("XHTMLMPSelectListRenderer");
29         } else {
30           setRendererType("SelectListRenderer");
31         }
32     }
33
34     final public String JavaDoc getValue() { return value_ ; }
35
36     final public UISelectList setValue(String JavaDoc s) {
37         value_ = s ;
38         return this ;
39     }
40
41     final public List JavaDoc getOptions() { return options_ ; }
42
43     final public UISelectList setOptions(List JavaDoc options) {
44         options_ = options ;
45         return this ;
46     }
47 }
48
49
Popular Tags