1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Set mapped resources on new launch configurations. This will let the platform know that they are associated and may be deleted when the project is deleted.

This commit is contained in:
Ken Ryall 2006-12-10 17:24:52 +00:00
parent 2a8fe7ad14
commit 6d4eea9995
4 changed files with 6 additions and 0 deletions

View file

@ -21,6 +21,7 @@ import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@ -236,6 +237,7 @@ public abstract class AbstractImportExecutableWizard extends Wizard implements I
*/
public void setConfigurationDefaults(ILaunchConfigurationWorkingCopy config, ICProject project) {
config.setMappedResources(new IResource[] {project.getProject()});
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getProject().getName());
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, new File(getImportExecutablePage()
.getSelectedExecutables()[0]).getName());

View file

@ -168,6 +168,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut {
configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(bin.getElementName()));
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, projectName);
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, bin.getCProject().getElementName());
wc.setMappedResources(new IResource[] {bin.getCProject().getProject()});
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null);
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true);
wc.setAttribute(

View file

@ -123,6 +123,7 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
String name = null;
if (cProject != null && cProject.exists()) {
name = cProject.getElementName();
config.setMappedResources(new IResource[] {cProject.getProject()});
}
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, name);

View file

@ -29,6 +29,7 @@ import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
import org.eclipse.cdt.ui.CElementLabelProvider;
import org.eclipse.cdt.utils.pty.PTY;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@ -276,6 +277,7 @@ public class CMainTab extends CLaunchConfigurationTab {
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
public void performApply(ILaunchConfigurationWorkingCopy config) {
config.setMappedResources(new IResource[] { this.getCProject().getProject() });
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText());
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText());
if (fTerminalButton != null) {