Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.debug.examples.ui/plugin.xml8
-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
3 files changed, 20 insertions, 1 deletions
diff --git a/org.eclipse.debug.examples.ui/plugin.xml b/org.eclipse.debug.examples.ui/plugin.xml
index 41fd1c716..c84e5956a 100644
--- a/org.eclipse.debug.examples.ui/plugin.xml
+++ b/org.eclipse.debug.examples.ui/plugin.xml
@@ -48,6 +48,9 @@
</with>
</enablement>
</contextualLaunch>
+ <configurationType
+ id="pda.launchType">
+ </configurationType>
</shortcut>
<shortcut
class="org.eclipse.debug.examples.ui.midi.launcher.MidiLaunchShortcut"
@@ -68,7 +71,10 @@
</iterate>
</with>
</enablement>
- </contextualLaunch>
+ </contextualLaunch>
+ <configurationType
+ id="midi.launchType">
+ </configurationType>
</shortcut>
</extension>
<!--#endif -->
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