1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

setDefaultDir() return the IProject location as the default.

This commit is contained in:
Alain Magloire 2002-11-22 04:27:47 +00:00
parent b189ce7272
commit f7336ab6b8

View file

@ -1,6 +1,8 @@
package org.eclipse.cdt.launch.internal.ui;
import java.io.File;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
import org.eclipse.cdt.launch.ICDTLaunchConfigurationConstants;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
@ -246,12 +248,15 @@ public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
* Sets the default working directory
*/
protected void setDefaultWorkingDir() {
ILaunchConfiguration config = getLaunchConfiguration();
ILaunchConfiguration config = getLaunchConfiguration();
if (config != null) {
// IJavaProject javaProject = JavaRuntime.getJavaProject(config);
Object cProject = null;
ICProject cProject = null;
try {
cProject = AbstractCLaunchDelegate.getCProject(config);
} catch (CoreException e) {
}
if (cProject != null) {
// fWorkspaceDirText.setText(cProject.getPath().makeRelative().toOSString());
fWorkspaceDirText.setText(cProject.getPath().makeRelative().toOSString());
fLocalDirButton.setSelection(false);
fWorkspaceDirButton.setSelection(true);
return;