comparison org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/swt/ButtonObservableValue.d @ 85:6be48cf9f95c

Work on databinding
author Frank Benoit <benoit@tionex.de>
date Sat, 18 Apr 2009 13:54:50 +0200
parents 0a55d2d5a946
children
comparison
equal deleted inserted replaced
84:fcf926c91ca4 85:6be48cf9f95c
30 30
31 private final Button button; 31 private final Button button;
32 32
33 private bool selectionValue; 33 private bool selectionValue;
34 34
35 private Listener updateListener = new class() Listener { 35 private Listener updateListener;
36 class UpdateListener : Listener {
36 public void handleEvent(Event event) { 37 public void handleEvent(Event event) {
37 bool oldSelectionValue = selectionValue; 38 bool oldSelectionValue = selectionValue;
38 selectionValue = button.getSelection(); 39 selectionValue = button.getSelection();
39 40
40 notifyIfChanged(oldSelectionValue, selectionValue); 41 notifyIfChanged(oldSelectionValue, selectionValue);
59 this.button = button; 60 this.button = button;
60 init(); 61 init();
61 } 62 }
62 63
63 private void init() { 64 private void init() {
65 updateListener = new UpdateListener();
64 button.addListener(SWT.Selection, updateListener); 66 button.addListener(SWT.Selection, updateListener);
65 button.addListener(SWT.DefaultSelection, updateListener); 67 button.addListener(SWT.DefaultSelection, updateListener);
66 } 68 }
67 69
68 public void doSetValue(Object value) { 70 public void doSetValue(Object value) {