Possible to generate diagram image file without a running workbench? [message #518346] |
Wed, 03 March 2010 20:34 |
Eclipse User |
|
|
|
Originally posted by: steenbrahe.gmail.com
Hi all,
We are developing an Eclipse runtime server without a GUI/Workbench.
Based on requests, the server is supposed to validate Ecore models and
build images of corresponding GMF diagrams.
We have run into a problem, that we cannot generate an image file from a
GMF diagram instance when the workbench is not running. We get an
IllegalStateException from the CopyToImageUtil class( or more precisely
the DiagramGraphicalViewer) because it calls the
PlatformUI.getWorkbench() method, which requires a running workbench
(see stacktrace below).
This is quite critical for us. Is there any way we can generate an image
file from a GMF diagram instance without having a running workbench?
Would it be a solution to reimplement all the GMF classes related to
CopyToImageUtil and out comment all PlatformUI.getWorkbench() calls?
Best regards
Steen Brahe
Detailed error message:
java.lang.IllegalStateException: Workbench has not been created yet.
at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalVie wer$ToggleUpdateManager.sendUpdateRequest(DiagramGraphicalVi ewer.java:92)
at
org.eclipse.draw2d.DeferredUpdateManager.queueWork(DeferredU pdateManager.java:231)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalVie wer$ToggleUpdateManager.queueWork(DiagramGraphicalViewer.jav a:132)
at
org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(De ferredUpdateManager.java:126)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1349)
at
org.eclipse.draw2d.LightweightSystem.setControl(LightweightS ystem.java:237)
at org.eclipse.draw2d.FigureCanvas.<init>(FigureCanvas.java:172)
at org.eclipse.draw2d.FigureCanvas.<init>(FigureCanvas.java:184)
at org.eclipse.draw2d.FigureCanvas.<init>(FigureCanvas.java:155)
at
org.eclipse.gef.ui.parts.ScrollingGraphicalViewer.createCont rol(ScrollingGraphicalViewer.java:50)
at
org.eclipse.gmf.runtime.diagram.ui.OffscreenEditPartFactory. createDiagramEditPart(OffscreenEditPartFactory.java:99)
at
org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUt il.createDiagramEditPart(CopyToImageUtil.java:86)
at
org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUt il.copyToImage(CopyToImageUtil.java:130)
|
|
|
Powered by
FUDForum. Page generated in 0.02233 seconds