[jbosstools-commits] JBoss Tools SVN: r17463 - branches/jbosstools-3.1.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Fri Sep 4 10:28:13 EDT 2009
Author: vyemialyanchyk
Date: 2009-09-04 10:28:13 -0400 (Fri, 04 Sep 2009)
New Revision: 17463
Modified:
branches/jbosstools-3.1.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java
Log:
try to fix junit test on hudson
Modified: branches/jbosstools-3.1.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java
===================================================================
--- branches/jbosstools-3.1.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java 2009-09-04 14:21:08 UTC (rev 17462)
+++ branches/jbosstools-3.1.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java 2009-09-04 14:28:13 UTC (rev 17463)
@@ -29,6 +29,7 @@
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.widgets.FileDialog;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
@@ -40,6 +41,7 @@
DiagramViewerMessages.ExportImageAction_jpg_format, DiagramViewerMessages.ExportImageAction_bmp_format };
private FileDialog saveDialog = null;
+ private boolean showErrDialog = true;
public static final ImageDescriptor img =
ImageDescriptor.createFromFile(DiagramViewer.class, "icons/export.png"); //$NON-NLS-1$
@@ -60,6 +62,10 @@
this.saveDialog = saveDialog;
}
+ public void setShowErrDialog(boolean showErrDialog) {
+ this.showErrDialog = showErrDialog;
+ }
+
public void run() {
if (saveDialog == null) {
@@ -91,9 +97,11 @@
outStream.write(imageData);
outStream.flush();
} catch (Exception e) {
- MessageDialog.openInformation(getDiagramViewer().getSite().getShell(),
+ HibernateConsolePlugin.getDefault().logErrorMessage("ExportImageAction", e); //$NON-NLS-1$
+ if (showErrDialog) {
+ MessageDialog.openInformation(getDiagramViewer().getSite().getShell(),
DiagramViewerMessages.ExportImageAction_error, DiagramViewerMessages.ExportImageAction_failed_to_export_image + e.getMessage());
- return;
+ }
}
finally {
if (outStream != null) {
More information about the jbosstools-commits
mailing list