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