Bug 175859 [DataBinding] Use MessageFormat for validation hints
The default hints produced by String2IntegerPrimitiveValidator and its peers are not very pleasant. They print extremely long numbers, are missing spaces, etc. For I18n, these hints should be produced via MessageFormat patterns, rather than with a hard-coded structure. This would also allow clients to override the messages by providing replacement patterns in a fragment. Boris, are there any issues with using java.text.MessageFormat under Foundation profiles? Should an ICU equivalent be used instead?
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/UpdateStrategyTest.java
assertDefaultConverter(String.class, Character.class, StringToCharacterConverter.class);
	}
	
	public void testDefaultConverterForStringToDate() throws Exception {
		assertDefaultConverter(String.class, Date.class, StringToDateConverter.class);
	}
	
	public void testDefaultConverterForStringToShort() throws Exception {
		assertDefaultConverter(String.class, Short.class, StringToShortConverter.class);
	}
	
	public void testDefaultConverterForStringToShortPrimitive() throws Exception {
		assertDefaultConverter(String.class, Short.TYPE, StringToShortPrimitiveConverter.class);
	}
	
	private void assertDefaultConverter(Class fromType, Class toType, Class converterType) {
		WritableValue source = WritableValue.withValueType(fromType);
		WritableValue destination = WritableValue.withValueType(toType);
		
		UpdateStrategyStub strategy = new UpdateStrategyStub();
		strategy.fillDefaults(source, destination);
		
		IConverter converter = strategy.converter;
		assertNotNull("converter not null", converter);
		assertEquals("fromType [" + fromType + "]" , fromType, converter.getFromType());
		assertEquals("toType [" + toType + "]", toType, converter.getToType());
		assertTrue("converter instanceof " + converterType, converterType.isInstance(converter));
	}
	
	class UpdateStrategyStub extends UpdateValueStrategy {