Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-03-23 20:23:41 +0000
committerMichael Valenta2004-03-23 20:23:41 +0000
commitc761aca970106698d13c9c90504ff7c87a7b3276 (patch)
treeb51f8ac1375f34f22cf983639258fd7e0adb5921
parent20e193ac7a931aef690aa540ef6f22cb8f5fe908 (diff)
downloadeclipse.platform.team-c761aca970106698d13c9c90504ff7c87a7b3276.tar.gz
eclipse.platform.team-c761aca970106698d13c9c90504ff7c87a7b3276.tar.xz
eclipse.platform.team-c761aca970106698d13c9c90504ff7c87a7b3276.zip
55284: SWTException: Invalid thread access doing an FTP upload
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java
index 9393842e0..bc0cb6bd6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java
@@ -15,6 +15,7 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.actions.*;
@@ -127,7 +128,17 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl
* @return a shell
*/
protected Shell getShell() {
- return Utils.getShell(getSite());
+ final Shell[] shell = new Shell[] { null };
+ if (canRunAsJob()) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ shell[0] = Utils.getShell(getSite());
+ }
+ });
+ } else {
+ shell[0] = Utils.getShell(getSite());
+ }
+ return shell[0];
}
/*

Back to the top