protected LaunchConfigurationBuildfileChange(ILaunchConfiguration launchConfiguration, String oldBuildFileName, String newBuildfileName, String newProjectName, boolean undo) throws CoreException { fLaunchConfiguration = launchConfiguration; fNewLaunchConfiguration = launchConfiguration.getWorkingCopy(); fNewBuildfileLocation = newBuildfileName; fNewProjectName = newProjectName; fOldBuildfileLocation = oldBuildFileName; fOldProjectName = fLaunchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null); if (fNewBuildfileLocation != null) { // generate the new configuration name String launchConfigurationName = fLaunchConfiguration.getName(); fNewLaunchConfigurationName = launchConfigurationName.replaceAll(oldBuildFileName, newBuildfileName); if (launchConfigurationName.equals(fNewLaunchConfigurationName) || (!undo && DebugPlugin.getDefault().getLaunchManager().isExistingLaunchConfigurationName(fNewLaunchConfigurationName))) { fNewLaunchConfigurationName = null; } } }
if (mgr.isExistingLaunchConfigurationName(currentName) || (reservednames != null ? reservednames.contains(currentName) : false)) { ILaunchConfiguration config = ((LaunchManager)mgr).findLaunchConfiguration(currentName);
/** * LaunchConfigurationProjectMainTypeChange constructor. * @param launchConfiguration the launch configuration to modify * @param newMainTypeName the name of the new main type, or <code>null</code> if not modified. * @param newProjectName the name of the project, or <code>null</code> if not modified. */ public LaunchConfigurationProjectMainTypeChange(ILaunchConfiguration launchConfiguration, String newMainTypeName, String newProjectName) throws CoreException { fLaunchConfiguration = launchConfiguration; fNewMainTypeName = newMainTypeName; fNewProjectName = newProjectName; fOldMainTypeName = fLaunchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, (String) null); fOldProjectName = fLaunchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null); if (fNewMainTypeName != null) { // generate the new configuration name String oldName = Signature.getSimpleName(fOldMainTypeName); String newName = Signature.getSimpleName(fNewMainTypeName); String lcname = fLaunchConfiguration.getName(); fNewLaunchConfigurationName = lcname.replaceAll(oldName, newName); if (lcname.equals(fNewLaunchConfigurationName) || DebugPlugin.getDefault().getLaunchManager().isExistingLaunchConfigurationName(fNewLaunchConfigurationName)) { fNewLaunchConfigurationName = null; } } }
fNewLaunchConfigurationName = launchConfigurationName.replaceFirst(oldProjectName, fNewProjectName); if (launchConfigurationName.equals(fNewLaunchConfigurationName) || DebugPlugin.getDefault().getLaunchManager().isExistingLaunchConfigurationName(fNewLaunchConfigurationName)) { fNewLaunchConfigurationName = null;