Load Resources [message #1858276] |
Sun, 26 March 2023 12:40  |
Eclipse User |
|
|
|
Hi,
1. I have defined an Xtext grammar "University" and I have generated an Ecore metamodel. The metamodel has a class named "Building" with a non containment reference "source" and Type "EPackage".
2. I launch a new runtime instance and inside a Java project named "ModelProject" I create a model instance "UniversityInstance" where I want to load a resource because I want to be able to add it as a value for the reference "source". The resource is located inside a jar file in the "Downloads" folder.
3. What I did was to create a new Java project named "Resource" in the eclipse workspace, unzip the jar file and add it in the java project. Then, I opened the runtime instance, and I right click on the "ModelProject" -> Configure Build Path -> Libraries -> Classpath -> Add External Class Folder and I choose the "Resource" folder in the workspace.
However, when I open the "UniversityInstance" textual editor and I try to reference the resource, it says it cannot resolve it. Am I doing something wrong? What would be the steps to properly be able to load the resource?
For clarification:
The structure of the "Resource" folder is as follows:
Resource
-src
-JRE System Library
-META INF
-org.eclipse.uml2.uml .... (contains)
--META INF
--org
--schema
--model (contains)
---UML.ecore (the resource I want to load).
Thank you for any help.
|
|
|
|
|
|
|
|
|
|
Re: Load Resources [message #1858293 is a reply to message #1858284] |
Mon, 27 March 2023 13:13  |
Eclipse User |
|
|
|
EPackage and UML is a far from trivial usage, since UML has no EPackage, although one may be stereotyped and UML.ecore is an Ecore formulation using EPackage at the metalevel. Further when you define a profile you create nested EPackages within EAnnotations within your UML model. It all gets very messy so without a repro we are left with three or four alternatives as to what you might mean by EPackage.
|
|
|
Powered by
FUDForum. Page generated in 0.03738 seconds