[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Binding the attribute of a bean object wrapped in a WritableValue object

I have a java bean such as Contact which has attributes such as name, address, email. The object presented to my code is a Wrapped WritableValue object, i.e. IObservableValue. For instance,
IObservableValue contactObservable = new WritableValue(new Contact(), Contact.class);


I tried to bind the name attributed of Contact bean wrapped in contactObservable to a text field. I did the following:

IObservableValue bindedNameTextObserveWidget = SWTObservables.observeText(text);
IObservableValue selectedContactNameObserveDetailValue = BeansObservables.observeDetailValue(Realm.getDefault(), contactObservable, "name", java.lang.String.class);


bindingContext.bindValue(bindedNameTextObserveWidget, contactObservable, null, null);

I did not get any error but this kind of binding does not work.

Any one knows how to bind the attribute of a writableValue object to a gui field instead of binding the attribute of a java bean to a gui field.