KickJava   Java API By Example, From Geeks To Geeks.

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


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:23:42 AM
12  */

13 public class DoubleSelect extends DoubleListUIBean {
14     final public static String JavaDoc TEMPLATE = "doubleselect";
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 DoubleSelect(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         // force the onchange parameter
51
addParameter("onchange", getParameters().get("name") + "Redirect(this.options.selectedIndex)");
52     }
53
54     public void setEmptyOption(String JavaDoc emptyOption) {
55         this.emptyOption = emptyOption;
56     }
57
58     public void setHeaderKey(String JavaDoc headerKey) {
59         this.headerKey = headerKey;
60     }
61
62     public void setHeaderValue(String JavaDoc headerValue) {
63         this.headerValue = headerValue;
64     }
65
66     public void setMultiple(String JavaDoc multiple) {
67         this.multiple = multiple;
68     }
69
70     public void setSize(String JavaDoc size) {
71         this.size = size;
72     }
73 }
74
Popular Tags