Source code: com/openwave/oui/waomelements/AbsPicker.java
1 package com.openwave.oui.waomelements;
2
3 import com.openwave.oui.framework.*;
4 import com.sun.java.util.collections.*;
5
6
7 /**
8 * This object is simple. It's basically just a wrapper around the <select>/<option> element.
9 * It allows users to select one option from a finite set of possible choices.
10 * Support for this object is similar in all the devices. There are mainly two reasons for encapsulating
11 * it: getting it to work with the Form object and protecting developers from possible problems when new
12 * devices are introduced.<br/>
13 * Creation date: (4/4/2001 3:37:20 PM)
14 * @author: Lars Gunder Knudsen
15 */
16 public class AbsPicker extends WaomLeaf {
17 String name = null;
18 String title = null;
19 String value = null;
20 String iname = null;
21 String ivalue = null;
22 boolean multiple = false;
23
24 ArrayList entries;
25
26 private final static long serialVersionUID = -4443618233068871186L;
27 /**
28 * Picker constructor.
29 * @param name The parameter represents the value of the name attribute and, ultimately, the name of the corresponding WML variable name.
30 * Creation date: (4/4/2001 3:39:40 PM)
31 * @param param java.lang.String
32 */
33 protected AbsPicker(String name) {
34 super();
35 this.name = name;
36 //waomElementName = "AbsPicker";
37 setWaomElementName("AbsPicker");
38 entries = new ArrayList();
39 }
40
41 public String getTitle() {
42 return this.title;
43 }
44 public void setTitle(String title) {
45 this.title = title;
46 }
47 public String getName() {
48 return this.name;
49 }
50 public void setName(String name) {
51 this.name = name;
52 }
53
54 public void addEntry(String value, String text){
55 entries.add(new Option(value,null,null,text));
56 }
57
58 public ArrayList getEntries(){
59 return entries;
60 }
61
62
63 public void addEntry(String value, String text, String onpick){
64 entries.add(new Option(value,null,onpick,text));
65 }
66
67
68 public String getIname() {
69 return this.iname;
70 }
71
72
73 public String getIvalue() {
74 return this.ivalue;
75 }
76
77
78 public String getMultiple() {
79 return (this.multiple?"true":"false");
80 }
81
82
83 public String getValue() {
84 return this.value;
85 }
86
87
88 public boolean isMultiple() {
89 return this.multiple;
90 }
91
92
93 public void setIname(String iname) {
94 this.iname = iname;
95 }
96
97
98 public void setIvalue(String ivalue) {
99 this.ivalue = ivalue;
100 }
101
102
103 public void setMultiple(String multiple) {
104 if(multiple.equalsIgnoreCase("true")){
105 this.multiple = true;
106 } else {
107 this.multiple = false;
108 }
109 }
110
111
112 public void setMultiple(boolean multiple) {
113 this.multiple = multiple;
114 }
115
116
117 public void setValue(String value) {
118 this.value = value;
119 }
120
121
122 public void visit(WaomVisitor wv){
123 wv.visit(this);
124 }
125 }