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/scenarios/PropertyScenarios.java
}
        };
        IValidator validator = new IValidator() {
            public IStatus validate(Object value) {
                Strg strgValue = (Strg) value;
                try {
                    double doubleValue = currencyFormat.parse(strgValue).doubleValue();
                    if (doubleValue < 0.0) {
                        return ValidationStatus.error(cannotBeNegativeMessage);
                    }
                    return Status.OK_STATUS;
                } catch (ParseException e) {
                    return ValidationStatus.error(mustBeCurrencyMessage);
                }
            }
        };
        BdSpec bdSpec = new DefaultBdSpec().setModelToTargetConverter(toCurrency)
                .setTargetToModelConverter(toDouble)
                .setTargetValidator(validator);
        getDbc().bdValue(SWTObservables.observeText(text, SWT.Modify),
                BeansObservables.observeValue(adventure, "price"),
                bdSpec);
        assertEquals("$5.00", text.getText());
        assertTrue(((IStatus)getDbc().getValidationStatus().getValue()).isOK());
        enterText(text, "$0.65");
        assertTrue(((IStatus)getDbc().getValidationStatus().getValue()).isOK());
        assertEquals(0.65, adventure.getPrice(), 0.0001);
        adventure.setPrice(42.24);
        assertEquals("$42.24", text.getText());
        assertTrue(((IStatus)getDbc().getValidationStatus().getValue()).isOK());