Created
July 18, 2012 13:53
-
-
Save yin/3136347 to your computer and use it in GitHub Desktop.
EMF.Edit bindings in WindowBuilder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This must be a field: | |
Editingdomain domain = getEditingDomain(); | |
// public DataBindingContext iniDataBindings() { ... | |
IObservableValue observeTextWidget = WidgetProperties.text(SWT.FocusOut).observe(txtTaskName); | |
IObservableValue observeSelection = ViewerProperties.singleSelection().observe(tasksTableViewer); | |
// [using EMFObservables] Generated by WindowBuilder | |
//IObservableValue taskNameValue = EMFObservables.observeDetailValue(Realm.getDefault(), observeSelection, Literals.TASK__NAME); | |
// [using EMFEditObservables] Works and shows up in Bindings page of WindowBuilder (but may becaome deprecated API) | |
IObservableValue taskNameValue = EMFEditObservables.observeDetailValue(Realm.getDefault(), domain, observeSelection, Literals.TASK_DEF__NAME); | |
// [using EMDEditProperties] Does NOT work and does not show in Bindings page of WindowBuilder | |
//IObservableValue tasksNameValue = EMFEditProperties.value(domain, Literals.TASK_DEF__NAME).observe(Realm.getDefault(), observeSelection); | |
bindingContext.bindValue(observeTextWidget, taskNameValue, null, null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment