Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2008-01-31 10:46:36 -0500
committerDarin Wright2008-01-31 10:46:36 -0500
commit296e9af6270db6ea21d3719e87b9f2fbe8ae9541 (patch)
tree065b38f4e31e1a5e46d1f374d4a766e654441d29 /org.eclipse.debug.examples.ui/src/org
parent602c0cf1f886c46d3151c6a5bebaf90330e2c01c (diff)
downloadeclipse.platform.debug-296e9af6270db6ea21d3719e87b9f2fbe8ae9541.tar.gz
eclipse.platform.debug-296e9af6270db6ea21d3719e87b9f2fbe8ae9541.tar.xz
eclipse.platform.debug-296e9af6270db6ea21d3719e87b9f2fbe8ae9541.zip
add resource mappings and lanuch types to launch shortcuts
Diffstat (limited to 'org.eclipse.debug.examples.ui/src/org')
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDAMainTab.java11
2 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java
index 2bbf75ee2..dfdbacefc 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java
@@ -12,6 +12,7 @@
package org.eclipse.debug.examples.ui.pda.launcher;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -60,6 +61,7 @@ public class PDALaunchShortcut implements ILaunchShortcut {
// create a new configuration for the pda file
ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null, file.getName());
workingCopy.setAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, path);
+ workingCopy.setMappedResources(new IResource[]{file});
ILaunchConfiguration configuration = workingCopy.doSave();
DebugUITools.launch(configuration, mode);
} catch (CoreException e1) {
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDAMainTab.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDAMainTab.java
index 59217fb54..30c39bae2 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDAMainTab.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDAMainTab.java
@@ -143,6 +143,17 @@ public class PDAMainTab extends AbstractLaunchConfigurationTab {
//#else
configuration.setAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, program);
//#endif
+
+ // perform resource mapping for contextual launch
+ IResource[] resources = null;
+ if (program!= null) {
+ IPath path = new Path(program);
+ IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+ if (res != null) {
+ resources = new IResource[]{res};
+ }
+ }
+ configuration.setMappedResources(resources);
}
/* (non-Javadoc)

Back to the top