+ /**
+ * Not used anymore, but kept because this routine may be useful in the
+ * future.
+ */
+ protected void addSelectedProjects(StringBuffer name, ISelection selection,
+ List<String> bundlesToStart) {
+ Assert.isNotNull(selection);
+
+ Map<String, IPluginModelBase> bundleProjects = new HashMap<String, IPluginModelBase>();
+ for (IPluginModelBase modelBase : PluginRegistry.getWorkspaceModels()) {
+ IProject bundleProject = modelBase.getUnderlyingResource()
+ .getProject();
+ bundleProjects.put(bundleProject.getName(), modelBase);
+ }
+
+ IStructuredSelection sSelection = (IStructuredSelection) selection;
+ for (Iterator<?> it = sSelection.iterator(); it.hasNext();) {
+ Object obj = it.next();
+ if (obj instanceof IProject) {
+ IProject project = (IProject) obj;
+ if (bundleProjects.containsKey(project.getName())) {
+ IPluginModelBase modelBase = bundleProjects.get(project
+ .getName());
+
+ BundleDescription bundleDescription = null;
+ if (modelBase.isFragmentModel()) {
+ BundleDescription[] hosts = modelBase
+ .getBundleDescription().getHost().getHosts();
+ for (BundleDescription bd : hosts) {
+ if (debug)
+ System.out.println("Host for "
+ + modelBase.getBundleDescription()
+ .getSymbolicName() + ": "
+ + bd.getSymbolicName());
+ bundleDescription = bd;
+ }
+ } else {
+ bundleDescription = modelBase.getBundleDescription();
+ }
+
+ if (bundleDescription != null) {
+ String symbolicName = bundleDescription
+ .getSymbolicName();
+ String bundleName = bundleDescription.getName();
+
+ bundlesToStart.add(symbolicName);
+
+ if (name.length() > 0)
+ name.append(" ");
+ if (bundleName != null)
+ name.append(bundleName);
+ else
+ name.append(symbolicName);
+ }
+ }
+ }
+ }
+ }