Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 10:54 Go to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
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 19:01 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 853
Registered: July 2009
Senior Member
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: Mon Aug 26 00:47:15 GMT 2019

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

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

Back to the top