Skip to main content



      Home
Home » Modeling » EMF » [EMF databinding] bind specific element in an EList by index
[EMF databinding] bind specific element in an EList by index [message #1386773] Fri, 20 June 2014 06:54 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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:54
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

Previous Topic:[CDO] Creating/connecting to local repository
Next Topic:[CDO] Collection returns contains = false for Query loaded object.
Goto Forum:
  


Current Time: Wed Jul 23 03:41:05 EDT 2025

Powered by FUDForum. Page generated in 0.06426 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top