Bug 159940 [DataBinding] DataBindingContext shouldn't expose the bindings list as a mutable list
Currently in DataBindingContext getBindings() exposes the bindings observable list as a mutable observable list. I think we need to make this an unmodifiable list and also add a removeBinding(Binding binding) method to the API of DataBindingContext so that the DBC can remove itself from the binding when removed from the DBC. I'll create a patch soon.
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/DatabindingContextTest.java
}
		super.tearDown();
	}
	protected void runTest() throws Throwable {
		try {
			super.runTest();
		} catch (Throwable th) {
			failed = true;
			throw th;
		}
	}
	public void testRegisterForDispose() {
		final boolean[] disposeCalled = new boolean[] { false };
		IObservableValue target = new WritableValue(Integer.TYPE) {
			public void dispose() {
				super.dispose();
				disposeCalled[0] = true;
			}
		};
		WritableValue model = new WritableValue(Integer.TYPE);
		model.setValue(new Integer(12));
		Display display = new Display();
		Shell shell = new Shell(display);
		final DataBindingContext dbc = DataBindingContext
				.createContext(new IObservableFactory[] {});
		registerContextToDispose(shell, dbc);
		dbc.registerForDispose(target);
		dbc.registerForDispose(model);
		dbc.bind(target, model, null);
		assertEquals("target should now have model's value", 12,