Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to update node adapters when xtext's EMF model changes(Xtext node adapter)
How to update node adapters when xtext's EMF model changes [message #1696356] Tue, 26 May 2015 04:34 Go to next message
khanh tran is currently offline khanh tranFriend
Messages: 8
Registered: November 2014
Junior Member
Hello all,

I found that if I create new EObject by using MyDslFactory (is generated by Xtext) then add to EMF model. The Xtext document is updated after save, but the NodeModelUtils.getNode(newobject) always return NULL.

Is there any way to update the Node Model when Xtext's EMF model change? Or how to get notifications when the XtextDocument is updated only when EMF model get change (not for text formatting e.g. when whitespace is inserted/removed).

Thanks.
Re: How to update node adapters when xtext's EMF model changes [message #1696667 is a reply to message #1696356] Wed, 27 May 2015 18:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
Hi,

from which place do you try to access the node model? maybe you should retrieve the new object from the document when further proceeding


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to update node adapters when xtext's EMF model changes [message #1697097 is a reply to message #1696356] Mon, 01 June 2015 14:21 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Modifications to the model are supposed to happen on the IXtextDocument
in a modify transaction. This ensures that the model is parseable
afterwards and the node model is up-to-date.

Best,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Find help at http://xtext.itemis.com or xtext(@)itemis.com
Blog: zarnekow.blogspot.com
Twitter: @szarnekow
Google+: https://www.google.com/+SebastianZarnekow
Previous Topic:XText for IntelliJ on Linux: NPE
Next Topic:Highlighting of hidden elements is not as expected
Goto Forum:
  


Current Time: Fri Apr 26 20:47:53 GMT 2024

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

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

Back to the top