Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Contextmenus #803

Closed
FelixJoehnk opened this issue Nov 29, 2022 · 3 comments
Closed

Multiple Contextmenus #803

FelixJoehnk opened this issue Nov 29, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@FelixJoehnk
Copy link

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

@FelixJoehnk FelixJoehnk added the enhancement New feature or request label Nov 29, 2022
@FelixJoehnk
Copy link
Author

Oh my sorry i wanted to add this to sprotty not here but might be somthing u want aswell :)

@planger
Copy link
Member

planger commented Dec 1, 2022

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.

@planger planger closed this as completed Dec 1, 2022
@FelixJoehnk
Copy link
Author

Sorry again for the trouble and the link to sprotty code is Sprotty Issue.
Best Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants