Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Population of emf model data values in content assist
Population of emf model data values in content assist [message #1228693] Tue, 07 January 2014 20:50 Go to next message
Shubha Somayaji is currently offline Shubha SomayajiFriend
Messages: 7
Registered: January 2014
Junior Member
Hello,

I needed quick favour from the experts as I am new to Xtext.

There is a EMF Model A which is loaded. And this Emf model A has EList.

Another dsl xtext grammer B which has some minimal grammer implemented. Content assist works fine for thst

Now I have a requirement to have Elist from A to be populated in the content assist. I did update the grammer file B to import the .ecore of model A and also updated Mwe2 to refer to the .genemodel of model A. Now I am not getting the heads up on how should get the Data in the EList of model A also to be populated in the content assist. I searched as much but nothing is in line with what I require.

Uploaded MWE2 and xtext for your reference

Your help will be really be appreciated.

Thanks
Shubha
Re: Population of emf model data values in content assist [message #1229021 is a reply to message #1228693] Wed, 08 January 2014 15:04 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13525
Registered: July 2009
Senior Member
Hi,

hi your grammar looks strange to me

if i understand you correct you have the following
- there a an ecore metamodel and you have an instance (not xtext based)
- you have a xtext grammar and want to reference non xtext stuff.

therefore you need an iresourceserviceprovider for the non xtext stuff
e.g. http://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Population of emf model data values in content assist [message #1229094 is a reply to message #1229021] Wed, 08 January 2014 17:57 Go to previous messageGo to next message
Shubha Somayaji is currently offline Shubha SomayajiFriend
Messages: 7
Registered: January 2014
Junior Member
Hi,

Thanks so much for the quick response.
I went through the blog and refers to more of a Class in the content assist. But I wanted to have EObject of that class in the content assist. Let me rephrase and explain what I want.

I have Ecore model with a EClass Person in that.

The Person class has EAttributes firstname and lastname.

Now the in the model there are 5 persons data stored like
firstNameA LastNameA
firstNameB LastNameB
firstNameC LastNameC
firstNameD LastNameD
firstNameE LastNameE

And also I have Xtext dsl grammer which has many other grammer implemented which has different contentassist working.



I would like to get the data(5 persons data stored) in my editor's content assist. I wanted help on that

Hope i am more clearer now.

Thanks so much
Shubha

[Updated on: Wed, 08 January 2014 18:01]

Report message to a moderator

Re: Population of emf model data values in content assist [message #1229101 is a reply to message #1229094] Wed, 08 January 2014 18:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13525
Registered: July 2009
Senior Member
Hi,

hi and what do you in content assist?
should you have a cross reference to a person and you can choose which one is it?


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Population of emf model data values in content assist [message #1229141 is a reply to message #1229101] Wed, 08 January 2014 20:07 Go to previous messageGo to next message
Shubha Somayaji is currently offline Shubha SomayajiFriend
Messages: 7
Registered: January 2014
Junior Member
Great!!!! that was quick. Thanks.

Yes I have to cross reference to a particular person and choose one through content assist on my editor.

Thanks again
Shubha

Re: Population of emf model data values in content assist [message #1229144 is a reply to message #1229141] Wed, 08 January 2014 20:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13525
Registered: July 2009
Senior Member
Hi,

this is exactly what i do with uml Classes.

do the same for your Person and you are fine


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Population of emf model data values in content assist [message #1229560 is a reply to message #1229144] Thu, 09 January 2014 18:09 Go to previous messageGo to next message
Shubha Somayaji is currently offline Shubha SomayajiFriend
Messages: 7
Registered: January 2014
Junior Member
Thanks so much Christian.

Ya with this I feel I converging to the point.
But I wanted a one more simple clarification.

Actually If I go with your UML example I want one of the attributes value to be cross referenced.
To put in the right way if Class has attributes like int X, String Y, then all the values of Y needs to cross referenced.

How can achieve that part.

[Updated on: Thu, 09 January 2014 18:10]

Report message to a moderator

Re: Population of emf model data values in content assist [message #1229563 is a reply to message #1229560] Thu, 09 January 2014 18:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13525
Registered: July 2009
Senior Member
hi

i am not sure if i got you.

i meant. to the same stuff i did for uml.ecore for your.ecore


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Population of emf model data values in content assist [message #1229564 is a reply to message #1229563] Thu, 09 January 2014 18:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13525
Registered: July 2009
Senior Member
if you want to cross reference a string you can do this
by

ref=[Thing|STRING]

maybe you should write a dsl for thing Things tooo.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Population of emf model data values in content assist [message #1229567 is a reply to message #1229564] Thu, 09 January 2014 18:26 Go to previous messageGo to next message
Shubha Somayaji is currently offline Shubha SomayajiFriend
Messages: 7
Registered: January 2014
Junior Member
Sorry for bothering you again.

What I mean is If I go with Person I need to cross reference only firstname then how will my dsl look like. I mean we need to refer to firstname somewhere right?

[Updated on: Thu, 09 January 2014 18:26]

Report message to a moderator

Re: Population of emf model data values in content assist [message #1229569 is a reply to message #1229567] Thu, 09 January 2014 18:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13525
Registered: July 2009
Senior Member
Hi,

am not quite sure what you mean.
you refer to a person through an identifer you give to it.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Population of emf model data values in content assist [message #1229572 is a reply to message #1229569] Thu, 09 January 2014 18:38 Go to previous messageGo to next message
Shubha Somayaji is currently offline Shubha SomayajiFriend
Messages: 7
Registered: January 2014
Junior Member
There is nothing called ID for it but there I have attribute in the Person Eclass as firstName which needs to be cross referenced.
Re: Population of emf model data values in content assist [message #1229573 is a reply to message #1229572] Thu, 09 January 2014 18:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13525
Registered: July 2009
Senior Member
hi you cannot do that.
you can refer to a person by its firstname.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Population of emf model data values in content assist [message #1229575 is a reply to message #1229573] Thu, 09 January 2014 18:42 Go to previous message
Shubha Somayaji is currently offline Shubha SomayajiFriend
Messages: 7
Registered: January 2014
Junior Member
Oh ok fine.

Thanks so much for your time and help.
Previous Topic:[Deleted]
Next Topic:Xtext Parser - Enhance parsed model
Goto Forum:
  


Current Time: Sun Aug 09 21:43:54 GMT 2020

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

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

Back to the top