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/databinding/DatabindingContextTest.java
/**
	 * Asserts that IStatus is populated and change events are fired when a
	 * Binding that is associated with a context is in error.
	 * 
	 * @throws Exception
	 */
	public void testValidationError() throws Exception {
		WritableValue targetObservable = WritableValue.withValueType(String.class);
		WritableValue modelObservable = WritableValue.withValueType(String.class);
		final String errorMessage = "error";
		DataBindingContext dbc = new DataBindingContext();
		ValueChangeCounter errorCounter = new ValueChangeCounter();
		ChangeCounter errorsCounter = new ChangeCounter();
		IObservableValue error = new AggregateValidationStatus(dbc
				.getBindings(), AggregateValidationStatus.MAX_SEVERITY);
		error.addValueChangeListener(errorCounter);
		assertTrue(((IStatus) error.getValue()).isOK());
		IObservableMap errors = dbc.getValidationStatusMap();
		errors.addChangeListener(errorsCounter);
		assertEquals(0, errors.size());
		IValidator validator = new IValidator() {
			public IStatus validate(Object value) {
				return ValidationStatus.error(errorMessage);
			}
		};
		dbc
				.bindValue(targetObservable, modelObservable,
						new DefaultBindSpec().addTargetValidator(
								BindingEvent.PIPELINE_AFTER_GET, validator));
		targetObservable.setValue("");