]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - ide/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/EclipseBootLaunchShortcut.java
Refactor SLC IDE
[gpl/argeo-slc.git] / ide / plugins / org.argeo.slc.ide.ui / src / main / java / org / argeo / slc / ide / ui / launch / osgi / EclipseBootLaunchShortcut.java
diff --git a/ide/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/EclipseBootLaunchShortcut.java b/ide/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/EclipseBootLaunchShortcut.java
deleted file mode 100644 (file)
index aa7f861..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.argeo.slc.ide.ui.launch.osgi;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.pde.ui.launcher.EclipseLaunchShortcut;
-
-/**
- * Launch shortcut simplifying the launch of an Eclipse application (typically
- * an RCP).
- */
-public class EclipseBootLaunchShortcut extends EclipseLaunchShortcut implements
-               OsgiLauncherConstants {
-       private StringBuffer name = null;
-       private IFile propertiesFile = null;
-
-       @Override
-       protected String getLaunchConfigurationTypeName() {
-               return EclipseBootLaunchConfiguration.ID;
-       }
-
-       @Override
-       public void launch(ISelection selection, String mode) {
-               // we assume that only one file is selected
-               IStructuredSelection sSelection = (IStructuredSelection) selection;
-               Iterator<?> it = sSelection.iterator();
-               propertiesFile = (IFile) it.next();
-
-               name = new StringBuffer(OsgiLaunchHelper.extractName(propertiesFile));
-
-               super.launch(selection, mode);
-       }
-
-       @Override
-       protected void initializeConfiguration(ILaunchConfigurationWorkingCopy wc) {
-               IResource[] resources = { propertiesFile };
-               wc.setMappedResources(resources);
-               super.initializeConfiguration(wc);
-
-               OsgiLaunchHelper.setDefaults(wc, true);
-               wc.setAttribute(
-                               IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
-                               OsgiLaunchHelper.findWorkingDirectory(propertiesFile));
-
-               OsgiLaunchHelper.updateLaunchConfiguration(wc, true);
-       }
-
-       protected String getName(ILaunchConfigurationType type) {
-               if (name != null && !name.toString().trim().equals(""))
-                       return DebugPlugin.getDefault().getLaunchManager()
-                                       .generateLaunchConfigurationName(name.toString());
-               else
-                       return DebugPlugin.getDefault().getLaunchManager()
-                                       .generateLaunchConfigurationName("SLC");
-       }
-
-       @Override
-       protected boolean isGoodMatch(ILaunchConfiguration configuration) {
-               if (name != null) {
-                       return name.toString().equals(configuration.getName());
-               }
-               return super.isGoodMatch(configuration);
-       }
-}