1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.seasar.uruma.binding.value.binder;
17
18 import org.eclipse.jface.viewers.ComboViewer;
19 import org.eclipse.swt.widgets.Combo;
20 import org.seasar.framework.beans.PropertyDesc;
21 import org.seasar.framework.util.StringUtil;
22 import org.seasar.uruma.binding.value.ValueBinder;
23 import org.seasar.uruma.component.UIComponent;
24
25
26
27
28
29
30 public class ComboViewerValueBinder extends AbstractValueBinder<ComboViewer> {
31
32
33
34
35
36 public ComboViewerValueBinder() {
37 super(ComboViewer.class);
38 }
39
40
41
42
43
44 @Override
45 public void doImportValue(final ComboViewer widget, final Object formObj,
46 final PropertyDesc propDesc, final UIComponent uiComp) {
47 Combo combo = widget.getCombo();
48 String text = combo.getText();
49 text = StringUtil.isEmpty(text) ? null : text;
50
51 logBinding(IMPORT_VALUE, widget, null, formObj, propDesc, text);
52
53 propDesc.setValue(formObj, text);
54 }
55 }