Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to get EditingDomain for XText Editor
How to get EditingDomain for XText Editor [message #815839] Thu, 08 March 2012 05:03 Go to next message
Sreekanth SC is currently offline Sreekanth SCFriend
Messages: 14
Registered: January 2011
Junior Member
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 21:48 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
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


---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:GenModel when using imported ecore model
Next Topic:Scoping in different contexts depending on non-resolved parameters
Goto Forum:
  


Current Time: Fri Apr 26 08:28:24 GMT 2024

Powered by FUDForum. Page generated in 0.03362 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top