]> 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/OsgiBootEquinoxLaunchConfiguration.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 / OsgiBootEquinoxLaunchConfiguration.java
index cbd84cbe75bf3ee3b3b48654c6e56b03ba2b40f7..c00b3075224ebb86d5e1f5509de12090faa185d4 100644 (file)
@@ -1,12 +1,5 @@
 package org.argeo.slc.ide.ui.launch.osgi;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
 import org.argeo.slc.ide.ui.SlcIdeUiPlugin;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
@@ -15,10 +8,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.pde.ui.launcher.EquinoxLaunchConfiguration;
-import org.eclipse.pde.ui.launcher.OSGiLaunchShortcut;
-import org.eclipse.swt.widgets.Display;
 
 public class OsgiBootEquinoxLaunchConfiguration extends
                EquinoxLaunchConfiguration {
@@ -44,44 +34,9 @@ public class OsgiBootEquinoxLaunchConfiguration extends
        protected void preLaunchCheck(ILaunchConfiguration configuration,
                        ILaunch launch, IProgressMonitor monitor) throws CoreException {
                // System.out.println("Launching... " + launch);
-               IFile propertiesFile = (IFile) configuration.getMappedResources()[0];
-
-               Properties properties = null;
-               try {
-                       properties = OsgiLaunchHelper.readProperties(propertiesFile);
-               } catch (CoreException e) {
-                       ErrorDialog.openError(Display.getCurrent().getActiveShell(),
-                                       "Error", "Cannot execute launch shortcut", e.getStatus());
-                       return;
-               }
-
-               List<String> bundlesToStart = new ArrayList<String>();
-               Map<String, String> systemPropertiesToAppend = new HashMap<String, String>();
-               OsgiLaunchHelper.interpretProperties(properties, bundlesToStart,
-                               systemPropertiesToAppend);
-
-               File workingDir = getWorkingDirectory(configuration);
-
                ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
-
-               // Reinitialize using standard OSGi launch shortcut
-               // Kind of a hack but it lacks extension capabilities and it is still
-               // cleaner than forking the code (which would imply a lot of fork indeed
-               // because of all the internal classes)
-               new OSGiLaunchShortcut() {
-                       @Override
-                       public void initializeConfiguration(
-                                       ILaunchConfigurationWorkingCopy configuration) {
-                               // TODO Auto-generated method stub
-                               super.initializeConfiguration(configuration);
-                       }
-               }.initializeConfiguration(wc);
-
-               OsgiLaunchHelper.updateLaunchConfiguration(wc, bundlesToStart,
-                               systemPropertiesToAppend, null, new File(workingDir, "data")
-                                               .getAbsolutePath());
+               OsgiLaunchHelper.updateLaunchConfiguration(wc);
                wc.doSave();
-
                super.preLaunchCheck(configuration, launch, monitor);
 
                // Note that if a Java project contains a build.properties it has to