Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Updating emf does not reflect on Node model(Updating emf does not reflect on Node model)
Updating emf does not reflect on Node model [message #1712835] Wed, 28 October 2015 15:35 Go to next message
kimi raikonnan is currently offline kimi raikonnanFriend
Messages: 145
Registered: June 2015
Senior Member
updating emf using lines below does not update the node model as F3 "go to declaration" does not work

for (EStructuralFeature crossRef : eStructuralFeatures) {
if(crossRef instanceof EReference) {
if (crossRef.getName().equals("aliasName")) {
declarationR.eSetDeliver(false);
declarationR.eSet(crossRef, alias);
}
}
}

any clue?

[Updated on: Wed, 28 October 2015 15:36]

Report message to a moderator

Re: Updating emf does not reflect on Node model [message #1712837 is a reply to message #1712835] Wed, 28 October 2015 16:06 Go to previous messageGo to next message
Stefan Oehme is currently offline Stefan OehmeFriend
Messages: 159
Registered: April 2010
Location: Kiel
Senior Member

Why did you open another topic for this?

As I said in the previous topic: Editing the EMF model in the BuilderParticipant has no effect on the editor.
Re: Updating emf does not reflect on Node model [message #1712848 is a reply to message #1712837] Wed, 28 October 2015 18:18 Go to previous messageGo to next message
kimi raikonnan is currently offline kimi raikonnanFriend
Messages: 145
Registered: June 2015
Senior Member
So Editing EMF in which location will effect the editor or Node Model?
Re: Updating emf does not reflect on Node model [message #1712889 is a reply to message #1712848] Thu, 29 October 2015 08:34 Go to previous messageGo to next message
Stefan Oehme is currently offline Stefan OehmeFriend
Messages: 159
Registered: April 2010
Location: Kiel
Senior Member

Without knowing your use case:

- use scoping or
- use LazyLinker#afterModelLinked
Re: Updating emf does not reflect on Node model [message #1712988 is a reply to message #1712848] Thu, 29 October 2015 17:37 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
On 28.10.15 19:18, kimi raikonnan wrote:
> So Editing EMF in which location will effect the editor or Node Model?

The node model will not be kept in sync if you do plain changes to the
EMF model. Use IXtextDocument.modify if you need that, but it is only
for interactive usecases. emf.Resource.save(..) will write changed
contents back to text and you can obtain a node model from that one.

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
Re: Updating emf does not reflect on Node model [message #1713001 is a reply to message #1712988] Thu, 29 October 2015 18:57 Go to previous message
kimi raikonnan is currently offline kimi raikonnanFriend
Messages: 145
Registered: June 2015
Senior Member
Hi Sebastian
alias T;
declaration decl1;

declaration.eSet(crossRef, alias);
declaration.eResource().save(saveOptions);
After saving i found that declaration's name become "T" also;
So what is written in the file is
Alias T;
Declaration T;
Any clue?
Previous Topic:Code template insertion error
Next Topic:is it possible to add link for EObject in XtextBuilderParticipant class
Goto Forum:
  


Current Time: Fri Apr 26 09:48:42 GMT 2024

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

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

Back to the top