How to get EditingDomain for XText Editor [message #815839] |
Thu, 08 March 2012 00:03  |
Eclipse User |
|
|
|
I am working on DSL editor project. I have set of property pages which needs to be filled when a selection is made in the Xtext editor. As of now I am able to get the model element from the xtext editor and get the required details and fill in the property sheets.
Now the problem is the other way around, when i try to edit something in the property sheet, the same has to be applied to the model, but when I edit in property sheet and try to save, I get a NullPointerException for my code, because I am getting the editing domain and then update the code. For Xtext editor i am not able to fetch the editing domain. This works fine for normal any other model editor for me.
Any help in this regard is very much appreciated. Any doubts please let me know. Thanks in advance.
|
|
|
Re: How to get EditingDomain for XText Editor [message #816449 is a reply to message #815839] |
Thu, 08 March 2012 16:48  |
Eclipse User |
|
|
|
An XtextEditor does not have an editing domain. As Xtext documents are
text, we use the TextEditor's infrastructure rather than EMFs when editing.
For semantic model access, you can use the XtextDocument.modify()
~.readOnly() methods. You have to adapt the property sheets - I assume
they are generated by EMF - yourself not to use an EditingDomain.
Am 08.03.12 06:03, schrieb Chikki Mising name:
> I am working on DSL editor project. I have set of property pages which
> needs to be filled when a selection is made in the Xtext editor. As of
> now I am able to get the model element from the xtext editor and get the
> required details and fill in the property sheets. Now the problem is the
> other way around, when i try to edit something in the property sheet,
> the same has to be applied to the model, but when I edit in property
> sheet and try to save, I get a NullPointerException for my code, because
> I am getting the editing domain and then update the code. For Xtext
> editor i am not able to fetch the editing domain. This works fine for
> normal any other model editor for me.
> Any help in this regard is very much appreciated. Any doubts please let
> me know. Thanks in advance.
>
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
|
|
|
Powered by
FUDForum. Page generated in 0.21911 seconds