diff options
author | Michael Valenta | 2004-12-15 21:49:16 +0000 |
---|---|---|
committer | Michael Valenta | 2004-12-15 21:49:16 +0000 |
commit | 5ff178e2a36e940ab3af252a4fcea202ca031bd6 (patch) | |
tree | bc3528a86f5f79d7f9f619ad7c1e3192351af097 /bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java | |
parent | 89fbbc5f0887e8905e610ff7ab3a47c7c6de6a7e (diff) | |
download | eclipse.platform.team-5ff178e2a36e940ab3af252a4fcea202ca031bd6.tar.gz eclipse.platform.team-5ff178e2a36e940ab3af252a4fcea202ca031bd6.tar.xz eclipse.platform.team-5ff178e2a36e940ab3af252a4fcea202ca031bd6.zip |
Diffstat (limited to 'bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java')
-rw-r--r-- | bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java index 1adcdb3ed..832f997bb 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java @@ -290,23 +290,12 @@ public class Utils { } public static Shell findShell() { - // First find the active shell of the display and use it. - // We need to do this since the active shell may be model - // in which case we nned to parent off that or risk deadlock - Display display= Display.getCurrent(); - if (display == null) { - display= Display.getDefault(); - } - if (display != null) { - return display.getActiveShell(); - } - // Try to use the active window (although I suspect this will fail if the bove failed) - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if(window != null) { - return window.getShell(); - } + Display display = TeamUIPlugin.getStandardDisplay(); + Shell activeShell = display.getActiveShell(); + if (activeShell != null) + return activeShell; // worst case, just create our own. - return new Shell(TeamUIPlugin.getStandardDisplay()); + return new Shell(display); } public static IWorkbenchPartSite findSite(Control c) { |