-
I'm currently not able revceive a actionDispatcher instance in the theia-ecore part of ecore-glsp. When working in sprotty-ecore i can inject it with I saw that the EcoreDiagramWidget got an instance by original thread by Leo Knoll |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Each sprotty diagram has its own DI container (and as a consequence its own instance of the action dispatcher) so it's not possible to simply inject the dispatcher into theia application code. If you want to use the action dispatcher in your theia application you would have to retrieve the currently active (diagram) widget and access its action dispatcher instance. |
Beta Was this translation helpful? Give feedback.
-
[Leo Knoll] Thanks for the quick response, so this will work as long as there is one diagram open. I guess there is no way if no diagram is open?
|
Beta Was this translation helpful? Give feedback.
-
Yes that's correct. If no diagram is opened you cannot access the action dispatcher. |
Beta Was this translation helpful? Give feedback.
Each sprotty diagram has its own DI container (and as a consequence its own instance of the action dispatcher) so it's not possible to simply inject the dispatcher into theia application code. If you want to use the action dispatcher in your theia application you would have to retrieve the currently active (diagram) widget and access its action dispatcher instance.