Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 94066 Details for
Bug 109290
[WorkbenchLauncher] splash screen blocks the switch workspace dialog and creates illusion of hung application
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Dumb patch. Nowhere near final.
splash-parent-patch.txt (text/plain), 10.08 KB, created by
Kim Horne
on 2008-03-28 16:57:21 EDT
(
hide
)
Description:
Dumb patch. Nowhere near final.
Filename:
MIME Type:
Creator:
Kim Horne
Created:
2008-03-28 16:57:21 EDT
Size:
10.08 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java,v >retrieving revision 1.147 >diff -u -r1.147 WorkbenchPlugin.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java 16 Jul 2007 19:29:10 -0000 1.147 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java 7 Jan 2008 19:23:30 -0000 >@@ -12,7 +12,11 @@ > package org.eclipse.ui.internal; > > import java.io.OutputStream; >-import java.util.*; >+import java.lang.reflect.InvocationTargetException; >+import java.lang.reflect.Method; >+import java.util.Collection; >+import java.util.HashSet; >+import java.util.Locale; > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IConfigurationElement; >@@ -28,6 +32,8 @@ > import org.eclipse.jface.window.Window; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.BusyIndicator; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.IEditorRegistry; > import org.eclipse.ui.IElementFactory; > import org.eclipse.ui.IPerspectiveRegistry; >@@ -63,7 +69,13 @@ > import org.eclipse.ui.presentations.AbstractPresentationFactory; > import org.eclipse.ui.views.IViewRegistry; > import org.eclipse.ui.wizards.IWizardRegistry; >-import org.osgi.framework.*; >+import org.osgi.framework.Bundle; >+import org.osgi.framework.BundleContext; >+import org.osgi.framework.BundleEvent; >+import org.osgi.framework.BundleListener; >+import org.osgi.framework.InvalidSyntaxException; >+import org.osgi.framework.ServiceReference; >+import org.osgi.framework.SynchronousBundleListener; > > import com.ibm.icu.text.MessageFormat; > >@@ -88,6 +100,13 @@ > */ > public class WorkbenchPlugin extends AbstractUIPlugin { > >+ /** >+ * The OSGi splash property. >+ * >+ * @sicne 3.4 >+ */ >+ private static final String PROP_SPLASH_HANDLE = "org.eclipse.equinox.launcher.splash.handle"; //$NON-NLS-1$ >+ > private static final String LEFT_TO_RIGHT = "ltr"; //$NON-NLS-1$ > private static final String RIGHT_TO_LEFT = "rtl";//$NON-NLS-1$ > private static final String ORIENTATION_COMMAND_LINE = "-dir";//$NON-NLS-1$ >@@ -1210,5 +1229,62 @@ > return startingBundles.contains(bundle); > } > } >+ >+ /** >+ * Return whether or not the OSGi framework has specified the handle of a splash shell. >+ * >+ * @return whether or not the OSGi framework has specified the handle of a splash shell >+ * @since 3.4 >+ */ >+ public static boolean isSplashHandleSpecified() { >+ return System.getProperty(PROP_SPLASH_HANDLE) != null; >+ } > >+ /** >+ * Get the splash shell for this workbench instance, if any. This will find >+ * the splash created by the launcher (native) code and wrap it in a SWT >+ * shell. >+ >+ * @param display the display to parent the shell on >+ * >+ * @return the splash shell or <code>null</code> >+ * @throws InvocationTargetException >+ * @throws IllegalAccessException >+ * @throws IllegalArgumentException >+ * @throws NumberFormatException >+ * @since 3.4 >+ */ >+ public static Shell getSplashShell(Display display) >+ throws NumberFormatException, IllegalArgumentException, >+ IllegalAccessException, InvocationTargetException { >+ String splashHandle = System.getProperty(PROP_SPLASH_HANDLE); >+ if (splashHandle == null) { >+ return null; >+ } >+ Shell splashShell = null; >+ // look for the 32 bit internal_new shell method >+ try { >+ Method method = Shell.class.getMethod( >+ "internal_new", new Class[] { Display.class, int.class }); //$NON-NLS-1$ >+ // we're on a 32 bit platform so invoke it with splash >+ // handle as an int >+ splashShell = (Shell) method.invoke(null, new Object[] { display, >+ new Integer(splashHandle) }); >+ } catch (NoSuchMethodException e) { >+ // look for the 64 bit internal_new shell method >+ try { >+ Method method = Shell.class >+ .getMethod( >+ "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ >+ >+ // we're on a 64 bit platform so invoke it with a long >+ splashShell = (Shell) method.invoke(null, new Object[] { >+ display, new Long(splashHandle) }); >+ } catch (NoSuchMethodException e2) { >+ // cant find either method - don't do anything. >+ } >+ } >+ >+ return splashShell; >+ } > } >Index: Eclipse UI/org/eclipse/ui/internal/Workbench.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java,v >retrieving revision 1.449 >diff -u -r1.449 Workbench.java >--- Eclipse UI/org/eclipse/ui/internal/Workbench.java 18 Dec 2007 15:34:36 -0000 1.449 >+++ Eclipse UI/org/eclipse/ui/internal/Workbench.java 7 Jan 2008 19:23:30 -0000 >@@ -20,7 +20,6 @@ > import java.io.InputStream; > import java.io.InputStreamReader; > import java.io.OutputStreamWriter; >-import java.lang.reflect.Method; > import java.util.ArrayList; > import java.util.Arrays; > import java.util.Dictionary; >@@ -533,8 +532,7 @@ > SafeRunnable run = new SafeRunnable() { > > public void run() throws Exception { >- String splashHandle = System.getProperty("org.eclipse.equinox.launcher.splash.handle"); //$NON-NLS-1$ >- if (splashHandle == null) { >+ if (! WorkbenchPlugin.isSplashHandleSpecified()) { > createSplash = false; > return; > } >@@ -547,31 +545,8 @@ > } > > Shell splashShell = splash.getSplash(); >- if (splashShell == null) { >- // look for the 32 bit internal_new shell method >- try { >- Method method = Shell.class >- .getMethod( >- "internal_new", new Class[] { Display.class, int.class }); //$NON-NLS-1$ >- // we're on a 32 bit platform so invoke it with splash >- // handle as an int >- splashShell = (Shell) method.invoke(null, new Object[] { >- display, new Integer(splashHandle) }); >- } catch (NoSuchMethodException e) { >- // look for the 64 bit internal_new shell method >- try { >- Method method = Shell.class >- .getMethod( >- "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ >- >- // we're on a 64 bit platform so invoke it with a long >- splashShell = (Shell) method.invoke(null, >- new Object[] { display, >- new Long(splashHandle) }); >- } catch (NoSuchMethodException e2) { >- // cant find either method - don't do anything. >- } >- } >+ if (splashShell == null) { >+ splashShell = WorkbenchPlugin.getSplashShell(display); > > if (splashShell == null) > return; >#P org.eclipse.ui.ide.application >Index: src/org/eclipse/ui/internal/ide/application/IDEApplication.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java,v >retrieving revision 1.4 >diff -u -r1.4 IDEApplication.java >--- src/org/eclipse/ui/internal/ide/application/IDEApplication.java 3 Oct 2007 13:29:34 -0000 1.4 >+++ src/org/eclipse/ui/internal/ide/application/IDEApplication.java 7 Jan 2008 19:23:31 -0000 >@@ -35,6 +35,7 @@ > import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.IWorkbench; > import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.internal.WorkbenchPlugin; > import org.eclipse.ui.internal.ide.ChooseWorkspaceData; > import org.eclipse.ui.internal.ide.ChooseWorkspaceDialog; > import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; >@@ -86,10 +87,15 @@ > Display display = createDisplay(); > > try { >- Shell shell = new Shell(display, SWT.ON_TOP); >+ boolean parentChooserOnShell = true; >+ Shell shell = WorkbenchPlugin.getSplashShell(display); >+ if (shell == null) { >+ shell = new Shell(display, SWT.ON_TOP); >+ parentChooserOnShell = false; >+ } > > try { >- if (!checkInstanceLocation(shell)) { >+ if (!checkInstanceLocation(shell, parentChooserOnShell)) { > Platform.endSplash(); > return EXIT_OK; > } >@@ -147,11 +153,12 @@ > /** > * Return true if a valid workspace path has been set and false otherwise. > * Prompt for and set the path if possible and required. >+ * @param parentChooserOnShell whether the workspace chooser should be parented on this shell > * > * @return true if a valid instance location has been set and false > * otherwise > */ >- private boolean checkInstanceLocation(Shell shell) { >+ private boolean checkInstanceLocation(Shell shell, boolean parentChooserOnShell) { > // -data @none was specified but an ide requires workspace > Location instanceLoc = Platform.getInstanceLocation(); > if (instanceLoc == null) { >@@ -213,7 +220,7 @@ > > boolean force = false; > while (true) { >- URL workspaceUrl = promptForWorkspace(shell, launchData, force); >+ URL workspaceUrl = promptForWorkspace(shell, launchData, force, parentChooserOnShell); > if (workspaceUrl == null) { > return false; > } >@@ -257,16 +264,16 @@ > * @param force > * setting to true makes the dialog open regardless of the > * showDialog value >+ * @param parentChooserOnShell whether the chooser should be parented on the provided shell or not > * @return An URL storing the selected workspace or null if the user has > * canceled the launch operation. > */ > private URL promptForWorkspace(Shell shell, ChooseWorkspaceData launchData, >- boolean force) { >+ boolean force, boolean parentChooserOnShell) { > URL url = null; > do { >- // don't use the parent shell to make the dialog a top-level >- // shell. See bug 84881. >- new ChooseWorkspaceDialog(null, launchData, false, true).prompt(force); >+ // okay to use the shell now - this is the splash shell >+ new ChooseWorkspaceDialog(parentChooserOnShell ? shell : null, launchData, false, true).prompt(force); > String instancePath = launchData.getSelection(); > if (instancePath == null) { > return null;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 109290
:
94066
|
94269