Embedded Editor wont list references to an external Ecore model [message #1750015] |
Thu, 15 December 2016 03:01  |
Eclipse User |
|
|
|
Hello there,
i followed the tutorial from Christian to link my editor with an external model (https://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/)
Its working fine with the generated editor.
Now i want to reuse the editor in an swt component (inside an eclipse) but it wont show the elements from other models. here is what i did:
ArithmeticsActivator arithmeticsActivator = ArithmeticsActivator.getInstance();
Injector injector = arithmeticsActivator.getInjector(ArithmeticsActivator.ARITHMETICS_DSL);
XtextResourceSet XtextResourceSet = injector.getInstance(XtextResourceSet.class);
XtextResourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
xtextResource = (XtextResource) XtextResourceSet.createResource(URI.createURI(someObjectFromTheOtherModel.eResource().getURI().trimSegments(1)+"/temp.arithmetics"));
comp.setLayout(GridLayoutFactory.fillDefaults().margins(1, 1).create());
EmbeddedEditorFactory factory = injector.getInstance(EmbeddedEditorFactory.class);
EmbeddedEditor embeddedEditor = factory.newEditor(getResourceProvider()).showErrorAndWarningAnnotations().withParent(comp);
EmbeddedEditorModelAccess partialEditorModelAccess = embeddedEditor.createPartialEditor(false);
embeddedEditor.createPartialEditor();
The Editor shows up and works just fine, but when i try to link to an existing element (space + strg) nothing shows up.
Thx for your time.
[Updated on: Thu, 15 December 2016 03:03] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06295 seconds