Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2010-11-10 17:12:11 -0500
committerkmoore2010-11-10 17:12:11 -0500
commit99745e67e59acbec34dcddc8ecf64fe2bc14ba81 (patch)
treecb5c8ef088b3bdcb076c8ae9dcf79b1ae3762160
parentbcd13e7116d4d258be2e56c11720a80cf90c9629 (diff)
downloadwebtools.dali-99745e67e59acbec34dcddc8ecf64fe2bc14ba81.tar.gz
webtools.dali-99745e67e59acbec34dcddc8ecf64fe2bc14ba81.tar.xz
webtools.dali-99745e67e59acbec34dcddc8ecf64fe2bc14ba81.zip
fixed ddl gen so that errors are displayed on the UI thread
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java31
1 files changed, 18 insertions, 13 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java
index fa6ddc15c4..ad930dd172 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java
@@ -26,8 +26,10 @@ import org.eclipse.jpt.core.JpaProject;
import org.eclipse.jpt.core.context.persistence.Persistence;
import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.eclipselink.core.internal.ddlgen.EclipseLinkDDLGenerator;
+import org.eclipse.jpt.eclipselink.ui.JptEclipseLinkUiPlugin;
import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
import org.eclipse.jpt.eclipselink.ui.internal.ddlgen.wizards.GenerateDDLWizard;
+import org.eclipse.jpt.ui.internal.util.SWTUtil;
import org.eclipse.jpt.utility.internal.StringTools;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
@@ -132,12 +134,8 @@ public class EclipseLinkDDLGeneratorUi
catch (OperationCanceledException e) {
return Status.CANCEL_STATUS;
}
- catch (RuntimeException re) {
- String msg = re.getMessage();
- String message = (msg == null) ? re.toString() : msg;
-
- this.logError(message);
- throw new RuntimeException(re);
+ catch (RuntimeException re) {
+ this.logException(re);
}
return Status.OK_STATUS;
}
@@ -146,16 +144,23 @@ public class EclipseLinkDDLGeneratorUi
EclipseLinkDDLGenerator.generate(puName, project, monitor);
}
- protected void logError(String message) {
+ protected void logException(RuntimeException re) {
+ String msg = re.getMessage();
+ String message = (msg == null) ? re.toString() : msg;
this.displayError(message);
+ JptEclipseLinkUiPlugin.log(re);
}
- private void displayError(String message) {
- MessageDialog.openError(
- getShell(),
- EclipseLinkUiMessages.EclipseLinkDDLGeneratorUi_error,
- message
- );
+ private void displayError(final String message) {
+ SWTUtil.syncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openError(
+ getShell(),
+ EclipseLinkUiMessages.EclipseLinkDDLGeneratorUi_error,
+ message
+ );
+ }
+ });
}
private Shell getShell() {

Back to the top