Skip to content

How to dispatch Action from File Menu to Java server without the Diagram Module #1332

Answered by tortmayr
amiths89 asked this question in General
Discussion options

You must be logged in to vote

You should be able to make this work with a little bit of customization.

In order to communicate with the GLSP server you need to use the GLSPClient. If you want to retrieve the client ouside of the context of an active diagram you can use the DiagramServiceProvider.

So in your custom command contribution, you can inject the DiagramServiceProvider and retrieve the GLSPClient for your contributionId, then send the action message. Here is a snippet of a potential implementation:

@injectable()
export class MyCommandContribution implements CommandContribution {
    @inject(DiagramServiceProvider)
    protected diagramServiceProvider: DiagramServiceProvider;

    protected clientContribution: G…

Replies: 1 comment 15 replies

Comment options

You must be logged in to vote
15 replies
@amiths89
Comment options

@planger
Comment options

@amiths89
Comment options

@tortmayr
Comment options

Answer selected by amiths89
@amiths89
Comment options

@amiths89
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants