]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - eclipse/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/OsgiBootLauncherTabGroup.java
Introduce specific tab to OSGi boot
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.ide.ui / src / main / java / org / argeo / slc / ide / ui / launch / osgi / OsgiBootLauncherTabGroup.java
index a184135867240951b83dcb6ebc8948cc4f4a3685..d7fa841a542eec1b110e76a0f3900d220a8697c7 100644 (file)
@@ -1,10 +1,12 @@
 package org.argeo.slc.ide.ui.launch.osgi;
 
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 import org.eclipse.debug.ui.CommonTab;
 import org.eclipse.debug.ui.EnvironmentTab;
 import org.eclipse.debug.ui.ILaunchConfigurationDialog;
 import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab;
 import org.eclipse.pde.ui.launcher.BundlesTab;
 import org.eclipse.pde.ui.launcher.OSGiLauncherTabGroup;
 import org.eclipse.pde.ui.launcher.OSGiSettingsTab;
@@ -15,8 +17,30 @@ public class OsgiBootLauncherTabGroup extends OSGiLauncherTabGroup {
        @Override
        public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
                ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
-                               new JavaArgumentsTab(), new EnvironmentTab(), new BundlesTab(),
-                               new OSGiSettingsTab(), new TracingTab(), new CommonTab() };
+                               new OsgiBootMainTab(), new EnvironmentTab(), new BundlesTab() {
+                                       private boolean activating = false;
+
+                                       @Override
+                                       public void performApply(
+                                                       ILaunchConfigurationWorkingCopy config) {
+                                               System.out.println("performApply");
+                                               super.performApply(config);
+                                               if (activating) {
+                                                       try {
+                                                               config.doSave();
+                                                       } catch (CoreException e) {
+                                                               e.printStackTrace();
+                                                       }
+                                                       activating = false;
+                                               }
+                                       }
+
+                                       @Override
+                                       public void activated(
+                                                       ILaunchConfigurationWorkingCopy workingCopy) {
+                                               activating = true;
+                                       }
+                               }, new OSGiSettingsTab(), new TracingTab(), new CommonTab() };
                setTabs(tabs);
        }