|
|
Re: XCore and Editor for Several Packages [message #1781650 is a reply to message #1781643] |
Sat, 10 February 2018 16:03 |
Eric Domeshek Messages: 12 Registered: October 2016 |
Junior Member |
|
|
Ed,
Thanks for the quick response. The blog post was helpful in understanding a bit more about XCore. However, I'm still having problems (with both dynamic and static editor approaches). For the record, I'm running in Oxygen's December release (as set up by Oomph with the intention of working on the Osate code base).
This time I'll include a specific test case:
***** root.xcore ****
@GenModel(childCreationExtenders="true", extensibleProviderFactory="true", editDirectory="/root.edit/src-gen", editorDirectory="/root.editor/src-gen")
package root
abstract class Item {
String name
}
abstract class Container extends Item {
contains Item[] items
}
**** sub1.xcore ****
@GenModel(childCreationExtenders="true", extensibleProviderFactory="true", editDirectory="/root.edit/src-gen", editorDirectory="/root.editor/src-gen")
package root.sub1
import root.*
class Sub1 extends Container {
}
class Sub1Item extends Item {
}
**** sub2.xcore ****
@GenModel(childCreationExtenders="true", extensibleProviderFactory="true", editDirectory="/root.edit/src-gen", editorDirectory="/root.editor/src-gen")
package root.sub2
import root.*
class Sub2 extends Container {
}
class Sub2Item extends Item {
}
So here's what I've tried:
1- Invoking "Create Dynamic Instance..." on the Sub1 class creates a new Sub1.xmi file. It seems to launch an XMI editor rather than the eCore editor. But if I close the XMI editor and double-click the new xmi file it then launches the eCore editor. That eCore editor shows me a root element of class Sub1 (as requested) and only lets me create new children for that root node of classes Sub1 or Sub1 Item (as expected). However, when I use "Load Resource..." to load the sub2.xcore file, I still am only offered those two choices as possible new child classes for my root object. I thought I would now also see options to create Sub2 and Sub2 Item instances as children.
2- With the annotations you suggested, I'm now getting edit and editor code generated into projects root.edit and root.editor. When I try "Run As > Eclipse Application" on root.editor and create a new "Sub1 Model" selecting a Sub1 as my root node. Again, the only new child options I get are for Sub1 or Sub1 Item. Again, I "Load Resource..." for the sub2.xcore, and again I do not get new options for creating new kinds of children defined in that model.
Am I missing something fundamental here?
Thanks,
--Eric
|
|
|
Re: XCore and Editor for Several Packages [message #1781677 is a reply to message #1781650] |
Mon, 12 February 2018 05:46 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
I'd suggest opening a Bugzilla with a complete self-contained sample, i.e., use File -> Export -> General -> Archive File to export your projects to zip and attach that to the Bugzilla. That way I can reproduce exactly what you have rather than try to synthesize it from scratch. Probably there isn't a bug, but it will save me time helping;.
Up front I can say that if all these models are in one project, that's generally not ideal from a code generation point of view, because each *.xcore induces a GenModel and some artifacts (the XyzPlugin.java, MANIFEST.MF, and plugin.xml for example) are generated on a per-GenModel basis so if they are co-located in one project they will tend to overwrite each other during code generation, so I'm not sure your test case is really workable.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03492 seconds