You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hy,
It might be nice to have different Context menus depending on the type of graph. Suppose we have graphs for two programming languages one providing a asynchronus region node the over one doesn't. Then we want to have the option to add a asynchronus section via context menu in the first graph but not in the second graph.
For this one would need to change the implementation of the IContextMenuServiceProvider. I think it would be enough to have a symbol for each language and a IContextMenuService would provide the context menu only for that symbol. Than we could change the call to get the contextmenuservice from the provider from no arguments given
"menuService = await this.contextMenuService();"
to
"menuService = await this.contextMenuService(symbol_for_graph);".
The symbol then should be part of the SModelRoot so it can be gained in runtime from an SModelElement in the mouselistener.
Best Regards Felix
The text was updated successfully, but these errors were encountered:
No problem, I'll close it here then and we will evaluate whether and how we reuse a potential solution to this issue in GLSP. @FelixJoehnk Can you please add a link to the Sprotty issue here once you've created it to keep the reference?
Just for completeness:
In theia-glsp context menus can already be specified by diagram type and you can add conditions to the commands that restrict whether they should show up.
One potential improvement that could be worth exploring is to query a diagram specific menu path instead of always the generic GLSP menu path. But there hasn't been a request to do that yet.
Hy,
It might be nice to have different Context menus depending on the type of graph. Suppose we have graphs for two programming languages one providing a asynchronus region node the over one doesn't. Then we want to have the option to add a asynchronus section via context menu in the first graph but not in the second graph.
For this one would need to change the implementation of the IContextMenuServiceProvider. I think it would be enough to have a symbol for each language and a IContextMenuService would provide the context menu only for that symbol. Than we could change the call to get the contextmenuservice from the provider from no arguments given
"menuService = await this.contextMenuService();"
to
"menuService = await this.contextMenuService(symbol_for_graph);".
The symbol then should be part of the SModelRoot so it can be gained in runtime from an SModelElement in the mouselistener.
Best Regards Felix
The text was updated successfully, but these errors were encountered: