Update the node model (INode) xText [message #1785311] |
Thu, 12 April 2018 06:43  |
Eclipse User |
|
|
|
Hi,
I have a question about updating the node model (INode) xText after adding the object in the embedded editor.
I have Sirius editor and xText editor. The Sirius editor is defined by a double-click on the node that opens the embedded editor (Xtext-Sirius-integration, https://github.com/ObeoNetwork/Xtext-Sirius-integration).
In an embedded editor, I add an object (eg Parameter1). I close the embedded editor (ctrl + enter). Sirius editor has changes, so I will save it.
Then I need to (programmatically) to determine the position of the object (Parameter1) in xText:
ICompositeNode node = NodeModelUtils.findActualNodeFor(Parameter1);
However, the findActualNodeFor method returns null because the INode for Parameter1 is not yet created. When I close the Sirius editor and open again, the findActualNodeFor method returns INode.
If I add the same object directly in the xText editor and save the editor, findActualNodeFor also returns INode.
Do you need to update node model the xText after close the embedded editor?
Thanks for every advice.
Martin
|
|
|
|
Re: Update the node model (INode) xText [message #1785426 is a reply to message #1785419] |
Fri, 13 April 2018 12:33  |
Eclipse User |
|
|
|
Hi
Conventional editors tend to be quite good these days at listening to the platform resource changed notifications to reload on change. An embedded editor is more specialized so it may be that the equivalent external observation/response has not been registered. It could work. Use a debugger to see how an Xtext editor updates, then see where the change notification gets lost for your embedded editor.
Regards
Ed Willink
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.26286 seconds