Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] nested attributes in table control([EMF Forms] nested attributes in table control)
[EMF Forms] nested attributes in table control [message #1725669] Sun, 06 March 2016 11:36 Go to next message
Martin Jonsson is currently offline Martin JonssonFriend
Messages: 21
Registered: March 2013
Junior Member
Hello all.

In standard EMF data binding there is support for nested attributes in a FeaturePath. So taking the EMF Forms Example Model, you could start with a user and then display subtask names for all tasks in a table viewer, like:

user->task->subtask->name

Better explained here:
http://tomsondev.bestsolution.at/2009/06/07/galileo-emf-databinding-part-2/

Is this supported in EMF Forms somehow? If not, work around? Planned in the future?

Many thanks
Martin

[Updated on: Sun, 06 March 2016 11:47]

Report message to a moderator

Re: [EMF Forms] nested attributes in table control [message #1725933 is a reply to message #1725669] Tue, 08 March 2016 14:53 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 174
Registered: May 2015
Senior Member
Hi Martin,
what exactly do you want to achieve?
So you want to display a table for the tasks. And for each task (witch is a row) you want to show the name of which subtask? All of them?
When you configure a table it will bind against a multi reference, such as tasks.
You can also configure the columns to show whatever you like, eg the name of the task or any other attribute that is reachable using 1to1 containment.
You can also use some additional DMRs like the IndexDMR that will allow you to provide a Path that ends with a multi reference, provide an index and a second dmr starting from the object (actually the eclass) in the list.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] nested attributes in table control [message #1725951 is a reply to message #1725933] Tue, 08 March 2016 15:31 Go to previous messageGo to next message
Martin Jonsson is currently offline Martin JonssonFriend
Messages: 21
Registered: March 2013
Junior Member
Hello Eugen.

Thanks for helping me out.

I would like the functionality in standard EMF data binding that allows to drill down in attributes of an object.

Like you said but attribute that is reachable using 1toN containment.

Here is a decent example, you see that we bind all the committers of all the subprojects of a project:

public IObservableList uc4(Project p) {
IEMFListProperty prop = EMFProperties.multiList(
ProjectPackage.Literals.PROJECT__SUBPROJECTS,
ProjectPackage.Literals.PROJECT__COMMITTERS
);
return prop.observe(p);
}

I hope this example is clear enough.

IndexDMR with index and then second dmr would actually fit my use case. How to I go about doing that?

Cheers
Martin

Re: [EMF Forms] nested attributes in table control [message #1725963 is a reply to message #1725951] Tue, 08 March 2016 16:16 Go to previous message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 174
Registered: May 2015
Senior Member
Hi Martin,
I see what you want.
No currently multilists are not supported by emfforms, but you can add custom support for this.

You will need to implement your own DMR.
In order to do so you need to create a custom DMR that extends the VFeaturePathDomainModelReference (you can also extend the VDomainModelReference if you like, but the VFeaturePathDomainModelReference has already all the fields you need).
You will then have to provide an own DomainModelReferenceConverterEMF (this is an osgi service) . There you can implement the convertToListProperty() method.
This will be enough to support your requirement.
What I can't guarantee right now is whether the table will be able to handle this use case or not, as we never tested this.

I can provide you more info if you like. We also are happy to accept a contribution for this.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:[EMFStore] EMFStore does not work with E4?
Next Topic:[Edapt] Modifying an existing operation
Goto Forum:
  


Current Time: Fri Apr 19 04:37:32 GMT 2024

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

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

Back to the top