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
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);
                }