Bug 147530 [DataBinding] Provide event objects for change listeners
Before data binding goes 1.0 it would be wise to provide EventObjects for the following listeners to ensure that the API doesn't preclude future expansion of the values supplied to listeners. Interfaces that would be affected: * IValueChangeListener * IValueChangingListener * IListChangeListener * ISetChangeListener * IMappingChangeListener
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/WritableValueTest.java
assertEquals(0, counter.count);
        
        
        writableValue.setValue("value");
        assertEquals(1, counter.count);
        
        
        writableValue.setValue("value");
        assertEquals(1, counter.count);
        
        
        writableValue.setValue(null);
        assertEquals(2, counter.count);
    }
    
    public void testDoSetValue() throws Exception {
        WritableValue writableValue = new WritableValue(SWTObservables.getRealm(Display.getDefault()), null);
        Object value = new Object();
        writableValue.setValue(value);
        assertEquals(value, writableValue.getValue());
    }
    
    private static class ValueChangeCounter implements IValueChangeListener {
        int count;
        public void handleValueChange(IObservableValue source, ValueDiff diff) {
            count++;
        }
    }
}