KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > components > Select


1 package com.opensymphony.webwork.components;
2
3 import com.opensymphony.xwork.util.OgnlValueStack;
4
5 import javax.servlet.http.HttpServletRequest JavaDoc;
6 import javax.servlet.http.HttpServletResponse JavaDoc;
7
8 /**
9  * User: plightbo
10  * Date: Jul 20, 2005
11  * Time: 8:01:12 AM
12  */

13 public class Select extends ListUIBean {
14     final public static String JavaDoc TEMPLATE = "select";
15
16     protected String JavaDoc emptyOption;
17     protected String JavaDoc headerKey;
18     protected String JavaDoc headerValue;
19     protected String JavaDoc multiple;
20     protected String JavaDoc size;
21
22     public Select(OgnlValueStack stack, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
23         super(stack, request, response);
24     }
25
26     protected String JavaDoc getDefaultTemplate() {
27         return TEMPLATE;
28     }
29
30     public void evaluateExtraParams() {
31         super.evaluateExtraParams();
32
33         if (emptyOption != null) {
34             addParameter("emptyOption", findValue(emptyOption, Boolean JavaDoc.class));
35         }
36
37         if (multiple != null) {
38             addParameter("multiple", findValue(multiple, Boolean JavaDoc.class));
39         }
40
41         if (size != null) {
42             addParameter("size", findString(size));
43         }
44
45         if ((headerKey != null) && (headerValue != null)) {
46             addParameter("headerKey", findString(headerKey));
47             addParameter("headerValue", findString(headerValue));
48         }
49     }
50
51     public void setEmptyOption(String JavaDoc emptyOption) {
52         this.emptyOption = emptyOption;
53     }
54
55     public void setHeaderKey(String JavaDoc headerKey) {
56         this.headerKey = headerKey;
57     }
58
59     public void setHeaderValue(String JavaDoc headerValue) {
60         this.headerValue = headerValue;
61     }
62
63     public void setMultiple(String JavaDoc multiple) {
64         this.multiple = multiple;
65     }
66
67     public void setSize(String JavaDoc size) {
68         this.size = size;
69     }
70 }
71
Popular Tags