Bug 127861 [DataBinding] Mark API provisional
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/viewers/UpdatableCollectionViewer.java
public void setSelectedObject(Object object) {
	    ISelection selection;
		if (object instanceof ISelection) {
			throw new BindingException("Selected object can not be an ISelection."); 
		}
		if (object == null) {
			selection = new StructuredSelection();
		} else {
			if (getElements().contains(object)) {
				selection = new StructuredSelection(object);
			} else { 
				return;
			}
		}
		final ISelection selectedObject = selection;
		SyncRunnable runnable = new SyncRunnable(){
			public Object run(){
				viewer.setSelection(selectedObject);
				return null;
			}
		};
		runnable.runOn(viewer.getControl().getDisplay());
	}
	public void setElements(List elements) {
		Object selection = getSelectedObject();
		super.setElements(elements);
		setSelectedObject(selection);
	}
}