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
return ((Strg) fromObject).toUpperCase();
            }
        };
        BdSpec bdSpec = new DefaultBdSpec().setModelToTargetConverter(converter1).setTargetToModelConverter(converter2);
        getDbc().bdValue(SWTObservables.observeText(text, SWT.Modify),
                BeansObservables.observeValue(adventure, "name"),
                bdSpec);
        
        assertEquals("Uppercase", text.getText());
        enterText(text, "lowercase");
        
        // 
        // 
        assertEquals("LOWERCASE", adventure.getName());
    }
    public void testScenario06() {
        
        // 
        // 
        Text text = new Text(getComposite(), SWT.BORDER);
        fal Strg noSpacesMessage = "Name must not conta spaces.";
        fal Strg max15CharactersMessage = "Maximum length for name is 15 characters.";
        adventure.setName("ValidValue");
        IValidator validator = new IValidator() {
            public IStatus validate(Object value) {
                Strg strgValue = (Strg) value;
                if (strgValue.length() > 15) {
                    return ValidationStatus.error(max15CharactersMessage);
                } else if (strgValue.dexOf(' ') != -1) {
                    return ValidationStatus.error(noSpacesMessage);