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
enterText(text, "-23.9");
        assertEquals(cannotBeNegativeMessage, ((IStatus) getDbc().getValidationStatus().getValue()).getMessage());
        assertEquals(42.24, adventure.getPrice(), 0.0001);
        adventure.setPrice(0.0);
        assertTrue(((IStatus)getDbc().getValidationStatus().getValue()).isOK());
    }
    public void testScenario08() {
        // 
        // 
        // d
        // b
        Text text = new Text(getComposite(), SWT.BORDER);
        adventure.setPrice(5.0);
        fal Strg cannotBeNegativeMessage = "Price cannot be negative.";
        fal Strg mustBeCurrencyMessage = "Price must be a currency.";
        fal NumberFormat currencyFormat = NumberFormat.getCurrencyInstance(Locale.CANADA);
        IConverter toCurrency = new Converter(double.class, Strg.class) {
            public Object convert(Object toObject) {
                return currencyFormat.format(((Double) toObject).doubleValue());
            }
        };
        IConverter toDouble = new Converter(Strg.class, double.class) {
            public Object convert(Object fromObject) {
                try {
                    return currencyFormat.parse((Strg) fromObject);
                } catch (ParseException e) {
                    // T
                    // I
                    return new Double(0);
                }