Bug 127861 [DataBinding] Mark API provisional
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/viewers/StructuredViewerUpdatableValue.java
/**
	 * @param viewer
	 * @param attribute
	 */
	public StructuredViewerUpdatableValue(StructuredViewer viewer,
			String attribute) {
		this.viewer = viewer;
		this.attribute = attribute;
		if (attribute.equals(ViewersProperties.SINGLE_SELECTION)) {
			viewer.addSelectionChangedListener(new ISelectionChangedListener() {
				public void selectionChanged(SelectionChangedEvent event) {
					if (!updating) {
						fireChangeEvent(ChangeEvent.CHANGE, null, computeValue());
					}
				}
			});
		} else {
			throw new IllegalArgumentException(
					"Attribute name not valid: " + attribute); 
		}
	}
	public void setValue(final Object value) {
		AsyncRunnable runnable = new AsyncRunnable(){
			public void run(){
				try {
					updating = true;
					if (attribute.equals(ViewersProperties.SINGLE_SELECTION)) {
						Object oldValue= computeValue();
						viewer.setSelection(value == null ? StructuredSelection.EMPTY
								: new StructuredSelection(value));