|
Re: Change context programmatically [message #1765579 is a reply to message #1765569] |
Mon, 12 June 2017 14:50 |
|
Hi,
The simple answer it no, not really.
The longer answer is that the "context" in the Change Context model operation is simply the default value of "self" to use for sub-operations. It's internal state managed by Sirius during a tool's execution and is only meaningful during the execution of the sub-elements of the "Change Context" operation.
What are your trying to accomplish? This may not be the tool you want/need.
Regards,
Pierre-Charles David
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Change context programmatically [message #1765653 is a reply to message #1765585] |
Tue, 13 June 2017 07:36 |
|
Martin Jedlicka wrote on Mon, 12 June 2017 17:05
I have a text editor xText and a graphical Sirius editor. If I put a node from a graphical editor, the changes will also be transferred to xText. However, if I put a node (even with an edge!) into xText, the changes will not be transferred to the graphic until a change context is introduced (eg. inserts another node).
I do not know why the xText -> Sirius changes will not be done, but somehow they have to be refreshed. In the model, those changes are (target), but they are not transferred to the graphical representation (DRepresentation).
i do not know how your two editors are connected together, but the effects you see have probably nothing to do with "Change Context" by itself. Executing a "Change Context $SOME_EXPRESSION" really only does two things: 1) evaluate the expression, 2) set a internal Sirius variable to the result. "Change Context" is really only one of many operations that can be executed as part of a tool, and by itself has nothing to do with "inserting another node".
Now, what you see is probably that executing some tool (which may or may not have a Change Context operation, that by itself is not relevant) forces Sirius to re-synchronize its graphical views with the current state of the underlying model. Sirius normally does it automatically when it detects the underlying model has changed, but this may be disabled if you have unchecked the "Automatic Refresh" preference (in Window > Preferences > Sirius), or if your diagram and/or mappings are unsynchonized.
This can be tested simply: after you "put a node (even with an edge!) into xText", invoke the Sirius refresh explicitly (F5 or the "Refresh" icon in the diagram's tabbar). Do the new elements appear then ? Note that depending on how your two editors are connected, you probably need to save the Xtext file; as long as the change only exists in the Xtext editor's in-memory version of the model, Sirius has now way to know about it.
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03017 seconds