|
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.Locale; |
15 |
import java.util.*; |
| 16 |
|
16 |
|
| 17 |
import org.eclipse.core.runtime.CoreException; |
17 |
import org.eclipse.core.runtime.CoreException; |
| 18 |
import org.eclipse.core.runtime.IConfigurationElement; |
18 |
import org.eclipse.core.runtime.IConfigurationElement; |
|
Lines 62-72
Link Here
|
| 62 |
import org.eclipse.ui.presentations.AbstractPresentationFactory; |
62 |
import org.eclipse.ui.presentations.AbstractPresentationFactory; |
| 63 |
import org.eclipse.ui.views.IViewRegistry; |
63 |
import org.eclipse.ui.views.IViewRegistry; |
| 64 |
import org.eclipse.ui.wizards.IWizardRegistry; |
64 |
import org.eclipse.ui.wizards.IWizardRegistry; |
| 65 |
import org.osgi.framework.Bundle; |
65 |
import org.osgi.framework.*; |
| 66 |
import org.osgi.framework.BundleContext; |
|
|
| 67 |
import org.osgi.framework.BundleListener; |
| 68 |
import org.osgi.framework.InvalidSyntaxException; |
| 69 |
import org.osgi.framework.ServiceReference; |
| 70 |
|
66 |
|
| 71 |
import com.ibm.icu.text.MessageFormat; |
67 |
import com.ibm.icu.text.MessageFormat; |
| 72 |
|
68 |
|
|
Lines 89-95
Link Here
|
| 89 |
* calls createExecutableExtension to create an executable |
85 |
* calls createExecutableExtension to create an executable |
| 90 |
* instance of our workbench class. |
86 |
* instance of our workbench class. |
| 91 |
*/ |
87 |
*/ |
| 92 |
public class WorkbenchPlugin extends AbstractUIPlugin { |
88 |
public class WorkbenchPlugin extends AbstractUIPlugin implements SynchronousBundleListener{ |
| 93 |
|
89 |
|
| 94 |
private static final String LEFT_TO_RIGHT = "ltr"; //$NON-NLS-1$ |
90 |
private static final String LEFT_TO_RIGHT = "ltr"; //$NON-NLS-1$ |
| 95 |
private static final String RIGHT_TO_LEFT = "rtl";//$NON-NLS-1$ |
91 |
private static final String RIGHT_TO_LEFT = "rtl";//$NON-NLS-1$ |
|
Lines 119-124
Link Here
|
| 119 |
// The context within which this plugin was started. |
115 |
// The context within which this plugin was started. |
| 120 |
private BundleContext bundleContext; |
116 |
private BundleContext bundleContext; |
| 121 |
|
117 |
|
|
|
118 |
// The set of currently starting bundles |
| 119 |
private Collection startingBundles = new HashSet(); |
| 120 |
|
| 122 |
/** |
121 |
/** |
| 123 |
* Global workbench ui plugin flag. Only workbench implementation is allowed to use this flag |
122 |
* Global workbench ui plugin flag. Only workbench implementation is allowed to use this flag |
| 124 |
* All other plugins, examples, or test cases must *not* use this flag. |
123 |
* All other plugins, examples, or test cases must *not* use this flag. |
|
Lines 844-849
Link Here
|
| 844 |
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) |
843 |
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) |
| 845 |
*/ |
844 |
*/ |
| 846 |
public void start(BundleContext context) throws Exception { |
845 |
public void start(BundleContext context) throws Exception { |
|
|
846 |
context.addBundleListener(this); |
| 847 |
super.start(context); |
847 |
super.start(context); |
| 848 |
bundleContext = context; |
848 |
bundleContext = context; |
| 849 |
|
849 |
|
|
Lines 1153-1157
Link Here
|
| 1153 |
} |
1153 |
} |
| 1154 |
return null; |
1154 |
return null; |
| 1155 |
} |
1155 |
} |
|
|
1156 |
|
| 1157 |
/* (non-Javadoc) |
| 1158 |
* @see org.osgi.framework.BundleListener#bundleChanged(org.osgi.framework.BundleEvent) |
| 1159 |
*/ |
| 1160 |
public void bundleChanged(BundleEvent event) { |
| 1161 |
synchronized (startingBundles) { |
| 1162 |
switch (event.getType()) { |
| 1163 |
case BundleEvent.STARTING : |
| 1164 |
startingBundles.add(event.getBundle()); |
| 1165 |
break; |
| 1166 |
case BundleEvent.STARTED : |
| 1167 |
case BundleEvent.STOPPED : |
| 1168 |
startingBundles.remove(event.getBundle()); |
| 1169 |
break; |
| 1170 |
default : |
| 1171 |
break; |
| 1172 |
} |
| 1173 |
} |
| 1174 |
} |
| 1175 |
|
| 1176 |
public boolean isStarting(Bundle bundle) { |
| 1177 |
synchronized (startingBundles) { |
| 1178 |
return startingBundles.contains(bundle); |
| 1179 |
} |
| 1180 |
} |
| 1156 |
|
1181 |
|
| 1157 |
} |
1182 |
} |