Author: vyemialyanchyk
Date: 2009-10-28 15:35:59 -0400 (Wed, 28 Oct 2009)
New Revision: 18342
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5076 - try to fix
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java 2009-10-28
17:01:11 UTC (rev 18341)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java 2009-10-28
19:35:59 UTC (rev 18342)
@@ -168,8 +168,9 @@
*/
private byte[] createImage(IFigure figure, int format) {
- Device device = getDiagramViewer().getEditPartViewer().getControl()
- .getDisplay();
+ //Device device = getDiagramViewer().getEditPartViewer().getControl()
+ // .getDisplay();
+ Device device = null;
Rectangle r = figure.getBounds();
ByteArrayOutputStream result = new ByteArrayOutputStream();
@@ -188,6 +189,8 @@
ImageLoader imageLoader = new ImageLoader();
imageLoader.data = new ImageData[] { image.getImageData() };
imageLoader.save(result, format);
+ } catch (Throwable e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("ExportImageAction -
save:", e); //$NON-NLS-1$
} finally {
if (g != null) {
g.dispose();