Bug 172765 [DataBinding] Consistency when registering property change listeners
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet010MasterDetail.java
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
/**
 * Snippet that displays a simple master detail use case. A list of persons is
 * displayed in a list and upon selection the name of the selected person will
 * be displayed in a Text widget.
 */
public class Snippet010MasterDetail {
	public static void main(String[] args) {
		final Display display = new Display();
		Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
			public void run() {
				Shell shell = new Shell(display);
				shell.setLayout(new GridLayout());
				Person[] persons = new Person[] { new Person("Me"),
						new Person("Myself"), new Person("I") };
				ListViewer viewer = new ListViewer(shell);
				viewer.setContentProvider(new ArrayContentProvider());
				viewer.setInput(persons);
				Text name = new Text(shell, SWT.BORDER | SWT.READ_ONLY);
				
				IObservableValue selection = ViewersObservables
						.observeSingleSelection(viewer);
				
				IObservableValue detailObservable = BeansObservables
						.observeDetailValue(Realm.getDefault(), selection,
								"name", String.class);