[EMF databinding] bind specific element in an EList by index [message #1386773] |
Fri, 20 June 2014 06:54  |
Eclipse User |
|
|
|
I am trying to bind a specific element in a EList to a widget.
My old (working) code used a single EObject, so no problem. The code was:
IJFXBeanValueProperty uiValueProp = JFXBeanProperties.value("value");
IEMFValueProperty mProp = EMFEditProperties.value(domain,
HyconmdePackage.Literals.OPERATION_PARAMETER__INPUT),
databindingContext.bindValue(uiValueProp.observe(inputTag),
mProp.observeDetail(master));
Now model has changed and I have an ELIST named
HyconmdePackage.Literals.OPERATION_PARAMETER__INPUTS.
I need to bind the FIRST entry in the EList exactly as before.
I tried something like (and other variations):
IEMFListProperty lProp = EMFEditProperties.list(domain,
HyconmdePackage.Literals.SIGNAL_CLIENT__INPUTS);
IEMFValueProperty vProp =
lProp.value(GenericUtil.getInstance().newAccessList(0));
databindingContext.bindValue(uiValueProp.observe(inputTag),
mProp.observeDetail(master));
.... but that does not seem to work.
I tried using FeaturePath, bu that doesn't seem to support indexing.
What's the right spell?
Thank in advance
Mauro
|
|
|
Re: [EMF databinding] bind specific element in an EList by index [message #1386817 is a reply to message #1386773] |
Fri, 20 June 2014 15:01  |
Eclipse User |
|
|
|
You could try creating an observable from the lProp and listen to list changes. And every time the list change event contains what you need (for example when the first entry in the list is available/added/removed/...), you would update your master whose detail you have already bound to the widget...
Mauro Condarelli wrote on Fri, 20 June 2014 12:54I am trying to bind a specific element in a EList to a widget.
My old (working) code used a single EObject, so no problem. The code was:
IJFXBeanValueProperty uiValueProp = JFXBeanProperties.value("value");
IEMFValueProperty mProp = EMFEditProperties.value(domain,
HyconmdePackage.Literals.OPERATION_PARAMETER__INPUT),
databindingContext.bindValue(uiValueProp.observe(inputTag),
mProp.observeDetail(master));
Now model has changed and I have an ELIST named
HyconmdePackage.Literals.OPERATION_PARAMETER__INPUTS.
I need to bind the FIRST entry in the EList exactly as before.
I tried something like (and other variations):
IEMFListProperty lProp = EMFEditProperties.list(domain,
HyconmdePackage.Literals.SIGNAL_CLIENT__INPUTS);
IEMFValueProperty vProp =
lProp.value(GenericUtil.getInstance().newAccessList(0));
databindingContext.bindValue(uiValueProp.observe(inputTag),
mProp.observeDetail(master));
.... but that does not seem to work.
I tried using FeaturePath, bu that doesn't seem to support indexing.
What's the right spell?
Thank in advance
Mauro
|
|
|
Powered by
FUDForum. Page generated in 0.06426 seconds