Community
Participate
Working Groups
I have written a pluglet that creates and manipulates many diagrams. Some of the manipulation require the pluglet to call LayoutService.getLayoutNode(Node node). This method creates off-screen edit parts for the diagram in order to obtain the actual dimensions for the given node. However, the method does not dispose of the edit parts or the underlying Windows shell and controls. As a result, the pluglet runs the first time but on the next run the entire Eclipse application hangs in SWT when it tries to create a new window for one of these off-screen edit parts. I created a temporary fix that enabled me to run the pluglet multiple times without hanging. The fix is in LayoutService.getLayoutNode(Node node). Just before the return statement, the shell for the off-screen edit part is displosed as follows: diagramEP.getViewer().getControl().getShell().dispose(); There should probably be a try catch block with a "finally" clause that disposes of the shell.
I believe this same issue occurs in LayoutService.layoutNodes(List, boolean, String).
- Deprecated the method createDiagramEditPart(Diagram diagram) in OffscreenEditPartFactory. Users should call the method that takes a Shell as this method was not disposing the Shell that it created. - LayoutService and DiagramRenderUtil methods now temporary create a Shell where needed and then dispose it. - PrinterHelper, PrintPreviewHelper, and DiagramPrinter were also creating a diagram editpart without disposing the shell, so I modified the code to dispose the shell.
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug