Bug 184818 [DataBinding] Typo in example 3
In the ViewModel.setText(String) method of the it's firing a change event for "test" and not "text". public void setText(String text) { String oldValue = this.text; this.text = text; firePropertyChange("test", oldValue, text); } This needs to be changed to "text".
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet002UpdateComboRetainSelection.java
viewModel.setChoices(newList);
                }
            });
            
            System.out.println(viewModel.getText());
            DataBindingContext dbc = new DataBindingContext();
            
            IObservableList list = MasterDetailObservables.detailList(BeansObservables.observeValue(viewModel, "choices"),
                    getListDetailFactory(),
                    String.class);
            dbc.bindList(SWTObservables.observeItems(combo), list, null, null); 
            dbc.bindValue(SWTObservables.observeText(combo), BeansObservables.observeValue(viewModel, "text"), null, null);
            
            
            shell.pack();
            shell.open();
            return shell;
        }
    }
    private static IObservableFactory getListDetailFactory() {
        return new IObservableFactory() {
            public IObservable createObservable(Object target) {
                WritableList list = WritableList.withElementType(String.class);
                list.addAll((Collection) target);
                return list;
            }
        };
    }
}