1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.common.ui.client.widgets; |
17 | |
|
18 | |
|
19 | |
import java.util.List; |
20 | |
|
21 | |
import org.kuali.student.common.ui.client.mvc.Callback; |
22 | |
import org.kuali.student.common.ui.client.widgets.impl.KSDropDownImpl; |
23 | |
import org.kuali.student.common.ui.client.widgets.list.KSSelectItemWidgetAbstract; |
24 | |
import org.kuali.student.common.ui.client.widgets.list.ListItems; |
25 | |
import org.kuali.student.common.ui.client.widgets.list.SelectionChangeHandler; |
26 | |
|
27 | |
import com.google.gwt.core.client.GWT; |
28 | |
import com.google.gwt.event.dom.client.BlurHandler; |
29 | |
import com.google.gwt.event.dom.client.FocusHandler; |
30 | |
import com.google.gwt.event.shared.HandlerRegistration; |
31 | |
import com.google.gwt.user.client.ui.Widget; |
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
public class KSDropDown extends KSSelectItemWidgetAbstract{ |
42 | |
|
43 | 0 | KSSelectItemWidgetAbstract dropDown = GWT.create(KSDropDownImpl.class); |
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | 0 | public KSDropDown(){ |
49 | 0 | this.initWidget(dropDown); |
50 | 0 | } |
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
@Override |
58 | |
public void selectItem(String id) { |
59 | 0 | dropDown.selectItem(id); |
60 | 0 | } |
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
@Override |
66 | |
public void deSelectItem(String id) { |
67 | 0 | dropDown.deSelectItem(id); |
68 | 0 | } |
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
@Override |
74 | |
public List<String> getSelectedItems() { |
75 | 0 | return dropDown.getSelectedItems(); |
76 | |
} |
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
@Override |
82 | |
public String getSelectedItem() { |
83 | 0 | return dropDown.getSelectedItem(); |
84 | |
} |
85 | |
|
86 | |
|
87 | |
|
88 | |
|
89 | |
@Override |
90 | |
public void onLoad() { |
91 | 0 | dropDown.onLoad(); |
92 | 0 | } |
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
@Override |
98 | |
public void setListItems(ListItems listItems) { |
99 | 0 | dropDown.setListItems(listItems); |
100 | 0 | } |
101 | |
|
102 | |
|
103 | |
|
104 | |
|
105 | |
public HandlerRegistration addSelectionChangeHandler(SelectionChangeHandler selectionHandler) { |
106 | 0 | return dropDown.addSelectionChangeHandler(selectionHandler); |
107 | |
} |
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | |
public ListItems getListItems() { |
113 | 0 | return dropDown.getListItems(); |
114 | |
} |
115 | |
|
116 | |
|
117 | |
|
118 | |
|
119 | |
public String getName() { |
120 | 0 | return dropDown.getName(); |
121 | |
} |
122 | |
|
123 | |
|
124 | |
|
125 | |
|
126 | |
@Override |
127 | |
public void setName(String name) { |
128 | 0 | dropDown.setName(name); |
129 | 0 | } |
130 | |
|
131 | |
public void setEnabled(boolean b) { |
132 | 0 | dropDown.setEnabled(b); |
133 | 0 | } |
134 | |
|
135 | |
@Override |
136 | |
public boolean isEnabled() { |
137 | 0 | return dropDown.isEnabled(); |
138 | |
} |
139 | |
|
140 | |
public boolean isBlankFirstItem() { |
141 | 0 | if (dropDown instanceof KSDropDownImpl){ |
142 | 0 | return ((KSDropDownImpl)dropDown).isBlankFirstItem(); |
143 | |
} else { |
144 | 0 | return false; |
145 | |
} |
146 | |
} |
147 | |
|
148 | |
|
149 | |
|
150 | |
|
151 | |
|
152 | |
|
153 | |
public void setBlankFirstItem(boolean blankFirstItem) { |
154 | 0 | if (dropDown instanceof KSDropDownImpl){ |
155 | 0 | ((KSDropDownImpl)dropDown).setBlankFirstItem(blankFirstItem); |
156 | |
} |
157 | 0 | } |
158 | |
|
159 | |
@Override |
160 | |
public void redraw() { |
161 | 0 | dropDown.redraw(); |
162 | 0 | } |
163 | |
|
164 | |
@Override |
165 | |
public HandlerRegistration addFocusHandler(FocusHandler handler) { |
166 | 0 | return dropDown.addFocusHandler(handler); |
167 | |
} |
168 | |
|
169 | |
@Override |
170 | |
public HandlerRegistration addBlurHandler(BlurHandler handler) { |
171 | 0 | return dropDown.addBlurHandler(handler); |
172 | |
} |
173 | |
|
174 | |
@Override |
175 | |
public void addWidgetReadyCallback(Callback<Widget> callback) { |
176 | 0 | dropDown.addWidgetReadyCallback(callback); |
177 | 0 | } |
178 | |
|
179 | |
@Override |
180 | |
public boolean isInitialized() { |
181 | 0 | return dropDown.isInitialized(); |
182 | |
} |
183 | |
|
184 | |
@Override |
185 | |
public void setInitialized(boolean initialized) { |
186 | 0 | dropDown.setInitialized(initialized); |
187 | 0 | } |
188 | |
|
189 | |
@Override |
190 | |
public void clear() { |
191 | 0 | dropDown.clear(); |
192 | 0 | } |
193 | |
} |