Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2009-12-04 15:27:25 -0500
committerDarin Wright2009-12-04 15:27:25 -0500
commit26b88ce36124d91efd64cdfa4d3b14bb1b689671 (patch)
treed55b44ccba2df2e6ce06da39d77c2e82db5ede83 /org.eclipse.core.externaltools
parent75d0e8da05b2309fbda13816a08c9de939b8fdf8 (diff)
downloadeclipse.platform.debug-26b88ce36124d91efd64cdfa4d3b14bb1b689671.tar.gz
eclipse.platform.debug-26b88ce36124d91efd64cdfa4d3b14bb1b689671.tar.xz
eclipse.platform.debug-26b88ce36124d91efd64cdfa4d3b14bb1b689671.zip
Bug 296965 - project of selected resource not resolved properly
Diffstat (limited to 'org.eclipse.core.externaltools')
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java
index aba44bbcd..d316f27e9 100644
--- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java
+++ b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java
@@ -234,8 +234,16 @@ public class ExternalToolsCoreUtil {
return projects;
}
} else if (scope.equals("${project}")) { //$NON-NLS-1$
- if(configuration.getFile()!=null)
- return new IProject[]{((IResource)configuration.getFile()).getProject()};
+ IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
+ try {
+ String pathString = manager.performStringSubstitution("${selected_resource_path}"); //$NON-NLS-1$
+ IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(pathString));
+ if (res != null && res.getProject() != null) {
+ return new IProject[]{res.getProject()};
+ }
+ } catch (CoreException e) {
+ // unable to resolve a selection
+ }
}
return new IProject[0];
}

Back to the top