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.
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/DataBindingContext.java
import org.eclipse.core.internal.databinding.ValueBinding;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
/**
 * A context for binding observable objects. This class is not intended to be
 * subclassed by clients.
 * 
 * <p>
 * <strong>EXPERIMENTAL</strong>. This class or interface has been added as
 * part of a work in progress. There is no guarantee that this API will remain
 * unchanged during the 3.2 release cycle. Please do not use this API without
 * consulting with the Platform/UI team.
 * </p>
 * 
 * @since 1.0
 * 
 */
public class DataBindingContext {
	private List bindingEventListeners = new ArrayList();
	private WritableList bindings;
	/**
	 * Unmodifiable version of {@link #bindings} for public exposure.
	 */
	private IObservableList unmodifiableBindings;
	private IObservableMap validationStatusMap;
	private Realm validationRealm;
	/**
	 * Creates a data binding context, using the current default realm for the
	 * validation observables.