Importing EObjects from non-XText models [message #1717924] |
Thu, 17 December 2015 18:30 |
Jérôme Fouletier Messages: 39 Registered: September 2010 Location: France |
Member |
|
|
Using XText 2.4.3 in an Eclipse Kepler SR2 platform
In the same idea as this older post, I am trying to reference EObjects defined in a model not expressed in XText. Looking at the blog post, it seems the linking can be made to work with minimal effort. However, my case has an important difference with the UML one, namely, the other model does not have (or need) an editor. It just sits either in a jar on the classpath, or in a project on the workbench.
The EMF model being referenced already has implemented:
- OtherModelResource extends ResourceImpl
- OtherModelResourceDescription extends AbstractResourceDescription
- OtherModelResourceDescriptionManager extends DefaultResourceDescriptionManager
- OtherModelResourceFactory extends ResourceFactoryImpl
- OtherModelQualifiedNameProvider
- OtherModelResourceDescriptionStrategy
- OtherModelRuntimeModule which defines getFileExtensions() to return "othermdl"
However, since there is no editor for ".othermdl" URIs, I'm a bit confused about the way I could make the XText-generated editor aware of that source of references, without vainly trying to open an editor when double-clicking those references.
- what should getLanguageName() return? some arbitrary string?
- do I really need ResourceDescription and ResourceDescriptionManager?
- Is it enough to have the other model's URI listed in the language's XText file?
Jerome
|
|
|
|
|
|
|
Re: Importing EObjects from non-XText models [message #1717979 is a reply to message #1717957] |
Fri, 18 December 2015 11:44 |
|
in newer xtext Versions you have not that much to implement.
i dont know if your stonage xtext Version has that already.
so i dont think you Need ResourceDescription and ResourceDescriptionManager in recent Versions.
have a look at
org.eclipse.xtext.ecore (EcoreRuntimeModule/AbstractGenericResourceRuntimeModule) org.eclipse.xtext.ui.ecore (EcoreUiModule/EmfUiModule)
These are the resourceserviceproviders xtext ships for .ecore files
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Powered by
FUDForum. Page generated in 0.03835 seconds