Skip to content

Get GLSP diagram selected elements from another widget #13394

Answered by planger
volodgo asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @volodgo,

Thank you for your interest in GLSP and Theia!

The Theia integration of GLSP actually forwards the diagram selection to the Theia Selection service, so you can just get Theia's SelectionService injected and listen for updates without the need to reach into the diagram widget directly.

//
// get the selection service injected:
@inject(SelectionService) protected readonly selectionService: SelectionService;
// to start listening for selection events:
const disposable = this.selectionService.onSelectionChanged(e => ...);
// to stop listening for selection, dispose the returned disposable of `onSelectionChanged`:
disposable.dispose();

The selection of GLSP editors will be a GlspS…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@volodgo
Comment options

@planger
Comment options

Answer selected by volodgo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants