|How to synchronize the EObject underneath the Xtext editor with another editor? [message #1209207]
||Mon, 25 November 2013 06:43
| Jens Rabe
Registered: September 2013
I have an Xtext editor to edit an EObject A. This object references an EObject B which is serialized with another method (currently via XMI, later using another Xtext grammar). The reference is non-containment. The B is used as an input to validate the consistency of the A. Now, when the B is edited and saved, the validation in the Xtext editor is still carried out on the "old" B before the save.|
The problem is, my custom B editor edits another instance of the same B than what is referenced from the A the Xtext editor shows.
How can I synchronize these two B instances? Searching the web brought me to EMF Transaction and TransactionalEditingDomains, but I cannot find a way to hook an editing domain into an Xtext editor.
My first guess would be to use IResourceChangeListeners and use them to figure out if an object has to be reloaded, and on a change of the relevant file, do myB.eResource().unload() and myB.eResource().load().
Is there a more elegant solution?
Powered by FUDForum
. Page generated in 0.02170 seconds