Bug 147530 [DataBinding] Provide event objects for change listeners
Before data binding goes 1.0 it would be wise to provide EventObjects for the following listeners to ensure that the API doesn't preclude future expansion of the values supplied to listeners. Interfaces that would be affected: * IValueChangeListener * IValueChangingListener * IListChangeListener * ISetChangeListener * IMappingChangeListener
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/DatabindingContextTest.java
import org.eclipse.core.databinding.observable.value.WritableValue;
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.internal.databinding.ListBinding;
import org.eclipse.core.internal.databinding.ValueBinding;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.swt.widgets.Display;
public class DatabindingContextTest extends TestCase {
	protected void setUp() throws Exception {
		super.setUp();
		Realm.setDefault(SWTObservables.getRealm(Display.getDefault()));
	}
	public void testDisposeBindings() throws Exception {
		DataBindingContext dbc = new DataBindingContext();
		Binding binding = new BindingStub(dbc);
		dbc.addBinding(binding);
		assertFalse(binding.isDisposed());
		dbc.dispose();
		assertTrue("binding should be diposed when dbc is disposed", binding
				.isDisposed());
	}
	public void testBindValue() throws Exception {
		DataBindingContext dbc = new DataBindingContext();
		IObservableValue target = new WritableValue(String.class);
		IObservableValue model = new WritableValue(String.class);
		Binding binding = dbc.bindValue(target, model, null);
		assertTrue("binding is of the incorrect type",
				binding instanceof ValueBinding);
	}