|
Lines 15-21
Link Here
|
| 15 |
import org.eclipse.debug.core.DebugPlugin; |
15 |
import org.eclipse.debug.core.DebugPlugin; |
| 16 |
import org.eclipse.debug.core.ILaunchConfiguration; |
16 |
import org.eclipse.debug.core.ILaunchConfiguration; |
| 17 |
import org.eclipse.debug.core.ILaunchConfigurationListener; |
17 |
import org.eclipse.debug.core.ILaunchConfigurationListener; |
| 18 |
import org.eclipse.pde.internal.core.PDECore; |
|
|
| 19 |
import org.eclipse.pde.internal.core.util.CoreUtility; |
18 |
import org.eclipse.pde.internal.core.util.CoreUtility; |
| 20 |
|
19 |
|
| 21 |
|
20 |
|
|
Lines 37-50
Link Here
|
| 37 |
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration) |
36 |
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration) |
| 38 |
*/ |
37 |
*/ |
| 39 |
public void launchConfigurationRemoved(ILaunchConfiguration configuration) { |
38 |
public void launchConfigurationRemoved(ILaunchConfiguration configuration) { |
| 40 |
File metadataLocation = new File(PDECore.getDefault().getStateLocation().toOSString()); |
39 |
File configDir = LaunchConfigurationHelper.getConfigurationLocation(configuration); |
| 41 |
File configDir = new File(metadataLocation, configuration.getName()); |
|
|
| 42 |
if (configDir.exists()) { |
40 |
if (configDir.exists()) { |
| 43 |
// rename the config area if it was auto-set by PDE when the launch configuration is renamed |
41 |
// rename the config area if it was auto-set by PDE when the launch configuration is renamed |
| 44 |
ILaunchConfiguration destination = DebugPlugin.getDefault().getLaunchManager().getMovedTo(configuration); |
42 |
ILaunchConfiguration destination = DebugPlugin.getDefault().getLaunchManager().getMovedTo(configuration); |
| 45 |
boolean delete = true; |
43 |
boolean delete = true; |
| 46 |
if (destination != null) { |
44 |
if (destination != null) { |
| 47 |
delete = !configDir.renameTo(new File(metadataLocation, destination.getName())); |
45 |
delete = !configDir.renameTo(LaunchConfigurationHelper.getConfigurationLocation(destination)); |
| 48 |
} |
46 |
} |
| 49 |
if (delete) |
47 |
if (delete) |
| 50 |
CoreUtility.deleteContent(configDir); |
48 |
CoreUtility.deleteContent(configDir); |