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
assertFalse(((IStatus) error.getValue()).isOK());
		assertEquals(errorMessage, ((IStatus) error.getValue()).getMessage());
		assertEquals(1, errors.size());
		assertEquals(1, errorsCounter.count);
		assertEquals(1, errorCounter.count);
		error.dispose();
	}
	/**
	 * Asserts that then
	 * {@link DataBindingContext#bindValue(IObservableValue, IObservableValue, org.eclipse.jface.databinding.DefaultBindSpec)}
	 * if invoked the created binding is added to the internal list of bindings.
	 * 
	 * @throws Exception
	 */
	public void testBindValueAddBinding() throws Exception {
		WritableValue targetValue = WritableValue.withValueType(String.class);
		WritableValue modelValue = WritableValue.withValueType(String.class);
		DataBindingContext dbc = new DataBindingContext();
		assertNotNull(dbc.getBindings());
		assertEquals(0, dbc.getBindings().size());
		Binding binding = dbc.bindValue(targetValue, modelValue, null);
		assertNotNull(binding);
		assertNotNull(dbc.getBindings());
		assertEquals(1, dbc.getBindings().size());
		assertEquals(binding, dbc.getBindings().get(0));
	}
	/**
	 * Asserts that when
	 * {@link DataBindingContext#bindList(IObservableList, IObservableList, org.eclipse.jface.databinding.DefaultBindSpec)}
	 * is invoked the created binding is added to the intenal list of bindings.