Improve SLC launch plugin
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 29 Jun 2012 11:55:22 +0000 (11:55 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 29 Jun 2012 11:55:22 +0000 (11:55 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@5394 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

eclipse/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/EclipseBootLaunchConfiguration.java
eclipse/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/EclipseBootLauncherTabGroup.java
eclipse/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/OsgiLaunchHelper.java

index 6611f209ba3cb830bc836c8fa0f2b5de8b5c7309..c45005f013c2b2b7c1ba0438d32f676083a15038 100644 (file)
@@ -1,5 +1,8 @@
 package org.argeo.slc.ide.ui.launch.osgi;
 
+import java.util.Map;
+import java.util.TreeMap;
+
 import org.argeo.slc.ide.ui.SlcIdeUiPlugin;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
@@ -33,12 +36,19 @@ public class EclipseBootLaunchConfiguration extends
                                monitor);
        }
 
+       @SuppressWarnings("unchecked")
        @Override
        protected void preLaunchCheck(ILaunchConfiguration configuration,
                        ILaunch launch, IProgressMonitor monitor) throws CoreException {
                ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
                OsgiLaunchHelper.updateLaunchConfiguration(wc, true);
                wc.doSave();
+               Map<String, ?> attrs = new TreeMap<String, Object>(
+                               (Map<String, String>) wc.getAttributes());
+               OsgiLaunchHelper.debug("WC " + wc);
+               for (String key : attrs.keySet())
+                       OsgiLaunchHelper.debug(key + "=" + attrs.get(key));
+
                super.preLaunchCheck(configuration, launch, monitor);
 
                // Note that if a Java project contains a build.properties it has to
index 3fffb8063931309b24341c0111ab016564f3413c..53794ed78d43636e3c9d53fba7099d303008482b 100644 (file)
@@ -7,6 +7,7 @@ import org.eclipse.debug.ui.ILaunchConfigurationTab;
 import org.eclipse.pde.ui.launcher.EclipseLauncherTabGroup;
 import org.eclipse.pde.ui.launcher.MainTab;
 import org.eclipse.pde.ui.launcher.OSGiSettingsTab;
+import org.eclipse.pde.ui.launcher.PluginsTab;
 import org.eclipse.pde.ui.launcher.TracingTab;
 
 /** Definition of the set of tabs used in Eclipse Boot launch configuration UI. */
@@ -17,6 +18,7 @@ public class EclipseBootLauncherTabGroup extends EclipseLauncherTabGroup {
                ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
                                new OsgiBootMainTab(true),
                                new MainTab(),
+                               new PluginsTab(),
                                // new PluginsTab() {
                                // private boolean activating = false;
                                //
index 6f54e64d120536b2c40e63f2461f68ff05c9eb35..54566b53c4fbb7a2188520d469a6f4f987185faa 100644 (file)
@@ -357,8 +357,7 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants {
         */
        protected static String convertBundleList(List<String> bundlesToStart,
                        String original) {
-               if (debug)
-                       System.out.println("Original bundle list: " + original);
+               debug("Original bundle list: " + original);
 
                StringTokenizer stComa = new StringTokenizer(original, ",");
                // sort by bundle symbolic name
@@ -380,8 +379,7 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants {
                        // We can now rely on bundleId value
 
                        if (bundleId.endsWith(".source")) {
-                               if (debug)
-                                       System.out.println("Skip source bundle " + bundleId);
+                               debug("Skip source bundle " + bundleId);
                                continue bundles;
                        } else if (bundleId
                                        .equals(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR)) {
@@ -402,8 +400,7 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants {
                        if (bundlesToStart.contains(bundleId)) {
                                bufBundles.append(bundleId).append('@').append("default:true");
                                modified = true;
-                               if (debug)
-                                       System.out.println("Will start " + bundleId);
+                               debug("Will start " + bundleId);
                        }
 
                        if (!modified)
@@ -545,4 +542,9 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants {
                }
        }
 
+       static void debug(Object obj) {
+               if (debug)
+                       System.out.println(obj);
+       }
+
 }