Skip to content

How to remove duplicate menu options for the diagram menu option #987

Answered by ndoschek
Abhay0294 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Abhay0294,

As Philip already mentioned we are planning to resolve this issue in a more generic way with the linked issue.
In the meantime, the suggested workaround could look like this:

Create a customized GLSPCommandHandler for each of your diagram types:

export function isMyCustomDiagramType(diagramType: string): boolean {
    return diagramType === MyCustomLanguage.diagramType;
}

export class MyCustomGLSPCommandHandler extends GLSPCommandHandler {
    override isEnabled(): boolean {
        return (
            this.diagramWidget !== undefined &&
            isMyCustomDiagramType(this.diagramWidget.diagramType) &&
            super.isEnabled()
        );
    }

    override isVisible

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Abhay0294
Comment options

@Abhay0294
Comment options

@ndoschek
Comment options

Answer selected by Abhay0294
@Abhay0294
Comment options

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