Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext document set content does not update the model immediately(Xtext model update)
Xtext document set content does not update the model immediately [message #1832672] Wed, 23 September 2020 04:45 Go to next message
Eclipse UserFriend
It is possible to trigger the update of the model after getDocument().set(content)?

The model seems to be updated later, not after updating the document content.
Re: Xtext document set content does not update the model immediately [message #1832675 is a reply to message #1832672] Wed, 23 September 2020 05:04 Go to previous messageGo to next message
Eclipse UserFriend
how do you access the model?
maybe you can call a readOnly on the xtextDocument
Re: Xtext document set content does not update the model immediately [message #1832682 is a reply to message #1832675] Wed, 23 September 2020 05:54 Go to previous messageGo to next message
Eclipse UserFriend
I access the model like this:
XtextResource resource = provider.getResource();
EList<EObject> content = resource.getContents();
domainModel = (Model) resource.getContents().get(0);

I called document.readOnly like below, I haven't added any code in the process method and now it seems to work:
document.readOnly(new IUnitOfWork.Void<XtextResource>() {
@Override
public void process(XtextResource state) throws Exception {
}
});

Thanks!
Re: Xtext document set content does not update the model immediately [message #1832683 is a reply to message #1832682] Wed, 23 September 2020 05:58 Go to previous message
Eclipse UserFriend
btw the propery way would be to do the read operation in that work
Previous Topic:Open call hierarchy option
Next Topic:Help with labeling features
Goto Forum:
  


Current Time: Mon Jul 07 13:22:10 EDT 2025

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

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

Back to the top