|
Lines 12-18
Link Here
|
| 12 |
package org.eclipse.ui.internal; |
12 |
package org.eclipse.ui.internal; |
| 13 |
|
13 |
|
| 14 |
import java.io.OutputStream; |
14 |
import java.io.OutputStream; |
| 15 |
import java.util.*; |
15 |
import java.lang.reflect.InvocationTargetException; |
|
|
16 |
import java.lang.reflect.Method; |
| 17 |
import java.util.Collection; |
| 18 |
import java.util.HashSet; |
| 19 |
import java.util.Locale; |
| 16 |
|
20 |
|
| 17 |
import org.eclipse.core.runtime.CoreException; |
21 |
import org.eclipse.core.runtime.CoreException; |
| 18 |
import org.eclipse.core.runtime.IConfigurationElement; |
22 |
import org.eclipse.core.runtime.IConfigurationElement; |
|
Lines 28-33
Link Here
|
| 28 |
import org.eclipse.jface.window.Window; |
32 |
import org.eclipse.jface.window.Window; |
| 29 |
import org.eclipse.swt.SWT; |
33 |
import org.eclipse.swt.SWT; |
| 30 |
import org.eclipse.swt.custom.BusyIndicator; |
34 |
import org.eclipse.swt.custom.BusyIndicator; |
|
|
35 |
import org.eclipse.swt.widgets.Display; |
| 36 |
import org.eclipse.swt.widgets.Shell; |
| 31 |
import org.eclipse.ui.IEditorRegistry; |
37 |
import org.eclipse.ui.IEditorRegistry; |
| 32 |
import org.eclipse.ui.IElementFactory; |
38 |
import org.eclipse.ui.IElementFactory; |
| 33 |
import org.eclipse.ui.IPerspectiveRegistry; |
39 |
import org.eclipse.ui.IPerspectiveRegistry; |
|
Lines 63-69
Link Here
|
| 63 |
import org.eclipse.ui.presentations.AbstractPresentationFactory; |
69 |
import org.eclipse.ui.presentations.AbstractPresentationFactory; |
| 64 |
import org.eclipse.ui.views.IViewRegistry; |
70 |
import org.eclipse.ui.views.IViewRegistry; |
| 65 |
import org.eclipse.ui.wizards.IWizardRegistry; |
71 |
import org.eclipse.ui.wizards.IWizardRegistry; |
| 66 |
import org.osgi.framework.*; |
72 |
import org.osgi.framework.Bundle; |
|
|
73 |
import org.osgi.framework.BundleContext; |
| 74 |
import org.osgi.framework.BundleEvent; |
| 75 |
import org.osgi.framework.BundleListener; |
| 76 |
import org.osgi.framework.InvalidSyntaxException; |
| 77 |
import org.osgi.framework.ServiceReference; |
| 78 |
import org.osgi.framework.SynchronousBundleListener; |
| 67 |
|
79 |
|
| 68 |
import com.ibm.icu.text.MessageFormat; |
80 |
import com.ibm.icu.text.MessageFormat; |
| 69 |
|
81 |
|
|
Lines 88-93
Link Here
|
| 88 |
*/ |
100 |
*/ |
| 89 |
public class WorkbenchPlugin extends AbstractUIPlugin { |
101 |
public class WorkbenchPlugin extends AbstractUIPlugin { |
| 90 |
|
102 |
|
|
|
103 |
/** |
| 104 |
* The OSGi splash property. |
| 105 |
* |
| 106 |
* @sicne 3.4 |
| 107 |
*/ |
| 108 |
private static final String PROP_SPLASH_HANDLE = "org.eclipse.equinox.launcher.splash.handle"; //$NON-NLS-1$ |
| 109 |
|
| 91 |
private static final String LEFT_TO_RIGHT = "ltr"; //$NON-NLS-1$ |
110 |
private static final String LEFT_TO_RIGHT = "ltr"; //$NON-NLS-1$ |
| 92 |
private static final String RIGHT_TO_LEFT = "rtl";//$NON-NLS-1$ |
111 |
private static final String RIGHT_TO_LEFT = "rtl";//$NON-NLS-1$ |
| 93 |
private static final String ORIENTATION_COMMAND_LINE = "-dir";//$NON-NLS-1$ |
112 |
private static final String ORIENTATION_COMMAND_LINE = "-dir";//$NON-NLS-1$ |
|
Lines 1210-1214
Link Here
|
| 1210 |
return startingBundles.contains(bundle); |
1229 |
return startingBundles.contains(bundle); |
| 1211 |
} |
1230 |
} |
| 1212 |
} |
1231 |
} |
|
|
1232 |
|
| 1233 |
/** |
| 1234 |
* Return whether or not the OSGi framework has specified the handle of a splash shell. |
| 1235 |
* |
| 1236 |
* @return whether or not the OSGi framework has specified the handle of a splash shell |
| 1237 |
* @since 3.4 |
| 1238 |
*/ |
| 1239 |
public static boolean isSplashHandleSpecified() { |
| 1240 |
return System.getProperty(PROP_SPLASH_HANDLE) != null; |
| 1241 |
} |
| 1213 |
|
1242 |
|
|
|
1243 |
/** |
| 1244 |
* Get the splash shell for this workbench instance, if any. This will find |
| 1245 |
* the splash created by the launcher (native) code and wrap it in a SWT |
| 1246 |
* shell. |
| 1247 |
|
| 1248 |
* @param display the display to parent the shell on |
| 1249 |
* |
| 1250 |
* @return the splash shell or <code>null</code> |
| 1251 |
* @throws InvocationTargetException |
| 1252 |
* @throws IllegalAccessException |
| 1253 |
* @throws IllegalArgumentException |
| 1254 |
* @throws NumberFormatException |
| 1255 |
* @since 3.4 |
| 1256 |
*/ |
| 1257 |
public static Shell getSplashShell(Display display) |
| 1258 |
throws NumberFormatException, IllegalArgumentException, |
| 1259 |
IllegalAccessException, InvocationTargetException { |
| 1260 |
String splashHandle = System.getProperty(PROP_SPLASH_HANDLE); |
| 1261 |
if (splashHandle == null) { |
| 1262 |
return null; |
| 1263 |
} |
| 1264 |
Shell splashShell = null; |
| 1265 |
// look for the 32 bit internal_new shell method |
| 1266 |
try { |
| 1267 |
Method method = Shell.class.getMethod( |
| 1268 |
"internal_new", new Class[] { Display.class, int.class }); //$NON-NLS-1$ |
| 1269 |
// we're on a 32 bit platform so invoke it with splash |
| 1270 |
// handle as an int |
| 1271 |
splashShell = (Shell) method.invoke(null, new Object[] { display, |
| 1272 |
new Integer(splashHandle) }); |
| 1273 |
} catch (NoSuchMethodException e) { |
| 1274 |
// look for the 64 bit internal_new shell method |
| 1275 |
try { |
| 1276 |
Method method = Shell.class |
| 1277 |
.getMethod( |
| 1278 |
"internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ |
| 1279 |
|
| 1280 |
// we're on a 64 bit platform so invoke it with a long |
| 1281 |
splashShell = (Shell) method.invoke(null, new Object[] { |
| 1282 |
display, new Long(splashHandle) }); |
| 1283 |
} catch (NoSuchMethodException e2) { |
| 1284 |
// cant find either method - don't do anything. |
| 1285 |
} |
| 1286 |
} |
| 1287 |
|
| 1288 |
return splashShell; |
| 1289 |
} |
| 1214 |
} |
1290 |
} |