Skip to content

How to create a custom GLSPDiagramWidget in 2.0 #1178

Answered by tortmayr
wss29 asked this question in Q&A
Discussion options

You must be logged in to vote

Note that if you just want to dispose a resource in your custom UIExtension its no longer necessary to create a custom widget at all.
With 2.0.0 the diagram container is now unloaded when the Diagram is closed. This means you can use the @preDestroy annotation of inversify to trigger your dispose method when the diagram is closed:

import {inject,preDestroy} from `inversify`;

@inject()
export class MyUIExtension extends AbstractUIExtension implements Disposable {
...

  @preDestroy()
  dipsose():void {
     // put your dispose logic here.
  }
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@tortmayr
Comment options

Answer selected by wss29
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants