Bug 167450 [DataBinding] Get rid of bind support factory magic
I finally realized that we don't need that other magic factory. I'll move fillBindSpecDefaults() and the methods it calls (createConverter, createValidator etc) to a new class DefaultBindSpec. Clients who want default validators and converters created for them just create a DefaultBindSpec as opposed to a (rather empty) BindSpec. I will also move the early type checking into DefaultBindSpec to make it optional as well.
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)
                .setValidator(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());