Bug 159539 [DataBinding] Create a static initializer to create DBC with support for java primitives
It seems like in most scenarios default support for converters and validators for java's primitive types would be desired when creating a DataBindingContext. Attaching patch...
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/DatabindingContextTest.java
}
	}
	
	public void testFillBindSpecDefaultsMultipleConvertersAndValidators() throws Exception {
		DataBindingContext dbc = new DataBindingContext();
		dbc.addBindSupportFactory(new DefaultBindSupportFactory());
		
		BindSpec bs = new BindSpec();
		bs.setModelToTargetConverters(new IConverter[] {
				null, new ToStringConverter(), null
		});
		bs.setTargetToModelConverters(new IConverter[] {
				null, new ConvertString2Byte(), null
		});
		
		dbc.fillBindSpecDefaults(dbc, bs, Object.class, Object.class);
		
		assertConverterType(bs, 0, IdentityConverter.class, bs.getModelToTargetConverters());
		assertConverterType(bs, 1, ToStringConverter.class, bs.getModelToTargetConverters());
		assertConverterType(bs, 2, IdentityConverter.class, bs.getModelToTargetConverters());
		assertConverterType(bs, 0, IdentityConverter.class, bs.getTargetToModelConverters());
		assertConverterType(bs, 1, ConvertString2Byte.class, bs.getTargetToModelConverters());
		assertConverterType(bs, 2, IdentityConverter.class, bs.getTargetToModelConverters());
	}
	private void assertConverterType(BindSpec bs, int element, Class clazz, IConverter[] converters) {
		assertEquals("model2target[" + element + "] = identity", clazz, converters[element].getClass());
	}