Bug 174555 [DataBinding] Run validation on binding construction
When a binding is created the assumption is that the UI is synchronized with the model. This means that the UI should reflect the state of the model's validity as well. In order to ensure that the UI reflects the model's validity the consumer needs to force a copy to model on instantiation of every binding. We need to remove this requirement.
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/ValueBindingTest_Policies.java
BindingEvent.PIPELINE_AFTER_CONVERT, listener.lastPosition);
		binding.updateModelFromTarget();
		assertEquals(target.getValue(), model.getValue());
	}
	public void testTargetValidatePolicy() throws Exception {
		int position = BindingEvent.PIPELINE_AFTER_GET;
		TrackLastListener listener = new TrackLastListener();
		ValueBinding binding = new ValueBinding(target, model, new BindSpec()
				.setModelUpdatePolicy(BindSpec.POLICY_EXPLICIT)
				.setTargetValidatePolicy(new Integer(position)));
		binding.init(dbc);
		binding.addBindingEventListener(listener);
		String value = "1";
		target.setValue(value);
		assertFalse(target.getValue().equals(model.getValue()));
		assertEquals("last position", position, listener.lastPosition);
	}
	public void testModelUpdatePolicyExplicitValidationDefault()
			throws Exception {
		TrackLastListener listener = new TrackLastListener();
		ValueBinding binding = new ValueBinding(target, model, new BindSpec()
				.setModelUpdatePolicy(BindSpec.POLICY_EXPLICIT));
		binding.init(dbc);
		binding.addBindingEventListener(listener);
		target.setValue("");
		assertEquals("default validation position",
				BindingEvent.PIPELINE_AFTER_CONVERT, listener.lastPosition);
	}
}