|
Re: Accessing attributes in different resources [message #1553076 is a reply to message #1553045] |
Thu, 08 January 2015 13:37 |
|
In the case that you have to traverse to the Entity referenced by the superType relationship, you can inject IJvmModelAssociations and use getPrimarySourceElement. But as super type, any Java type would be allowed here, and the method will return null for this case.
The IJvmModelAssociations can be used as long as it is expected that the referenced element originates from the one language. In the case that multiple DSLs are used, the language specific model associations have to be retrieved like this:
val type = ref.type
val modelAssociations = (type.eResource as XtextResource).resourceServiceProvider.get(IJvmModelAssociations)
val sourceElem = modelAssociations.getPrimarySourceElement(ref.type)
(this won't be you case)
HTH,
~Karsten
Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04366 seconds