Strange errors using Xtext in a plugin [message #724332] |
Mon, 12 September 2011 06:29 |
Daniel Trierweiler Messages: 67 Registered: June 2011 |
Member |
|
|
Hey guys!
I've previously made some posts to this topic, which really helped me resolve some errors, but now I am stuck again and don't know where to search for a solution...
I've made a plugin for eclipse, which uses a table-framework to show the model-data. I've used the plugin wizard to create a MultiPageEditor and started from there. My Editor-code looks like that:
IEditorInput editorInput;
XtextResource resource = null;
static Injector injector = null;
public NatTableEditor() {
super();
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
}
void createPage() throws IOException {
if(injector == null)
injector = new ConfiguratorStandaloneSetup().createInjectorAndDoEMFRegistration();
URI uri = URI.createURI("platform:/resource/zf.pios.test/"+getEditorInput().getName());
setPartName(getEditorInput().getName());
XtextResourceSet rs = injector.getInstance(XtextResourceSet.class);
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
resource = (XtextResource) resourceFactory.createResource(uri);
rs.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
rs.getResources().add(resource);
resource.load(rs.getLoadOptions());
EcoreUtil.resolveAll(resource);
EList<EObject> list = resource.getContents();
Configuration eObj = (Configuration)list.get(0);
}
And everything is working fine. I can view and browse the data in the way I want. BUT... when I close the editor and reopen it, it gives me errors which I can't resolve:
http://pastebin.com/x93qwwcs
Does anyone have an idea what this could be? Or what it could be related with?
Thanks a lot!
Greetings,
Daniel
[Updated on: Mon, 12 September 2011 06:34] Report message to a moderator
|
|
|
|
|
|
|
Re: Strange errors using Xtext in a plugin [message #724378 is a reply to message #724374] |
Mon, 12 September 2011 08:44 |
|
Hi, I don't understand your question. The factory is already used a thousand times in the plugin xml so using it a 1001st time should be no problem.
<extension
point="org.eclipse.ui.editors">
<editor
class="org.xtext.example.mydsl.ui.MyDslExecutableExtensionFactory:org.eclipse.xtext.ui.editor.XtextEditor"
contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
default="true"
extensions="mydsl"
id="org.xtext.example.mydsl.MyDsl"
name="MyDsl Editor">
</editor>
</extension>
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[Updated on: Mon, 12 September 2011 08:50] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04874 seconds