1 11 package org.eclipse.pde.internal.ui.launcher; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.debug.core.ILaunchConfiguration; 15 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; 16 import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; 17 import org.eclipse.pde.internal.ui.IPDEUIConstants; 18 19 public class OSGiMigrationDelegate extends PDEMigrationDelegate { 20 21 public boolean isCandidate(ILaunchConfiguration candidate) throws CoreException { 22 return super.isCandidate(candidate) 23 || !candidate.getAttribute(IPDEUIConstants.LAUNCHER_PDE_VERSION, "").equals("3.3"); } 25 26 public void migrate (ILaunchConfigurationWorkingCopy wc) throws CoreException { 27 if (!wc.getAttribute(IPDEUIConstants.LAUNCHER_PDE_VERSION, "").equals("3.3")) { wc.setAttribute(IPDEUIConstants.LAUNCHER_PDE_VERSION, "3.3"); StringBuffer vmArgs = new StringBuffer (wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "")); if (vmArgs.indexOf("-Declipse.ignoreApp") == -1) { if (vmArgs.length() > 0) 32 vmArgs.append(" "); vmArgs.append("-Declipse.ignoreApp=true"); } 35 if (vmArgs.indexOf("-Dosgi.noShutdown") == -1) { vmArgs.append(" -Dosgi.noShutdown=true"); } 38 wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs.toString()); 39 } 40 super.migrate(wc); 41 } 42 43 } 44 | Popular Tags |