Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2011-09-06 16:13:34 +0000
committerPawel Piech2011-09-06 16:13:34 +0000
commit8dfa641ff497d7f205952186bf5a49fb0c04f7bd (patch)
treef1e522e8188a5316f8ef101e500b547d41988a87
parent3f60b2de0d0f0563dbe2657abc4da18776bac8db (diff)
downloadeclipse.platform.debug-8dfa641ff497d7f205952186bf5a49fb0c04f7bd.tar.gz
eclipse.platform.debug-8dfa641ff497d7f205952186bf5a49fb0c04f7bd.tar.xz
eclipse.platform.debug-8dfa641ff497d7f205952186bf5a49fb0c04f7bd.zip
Bug 356651 - [run control] Terminate and Relaunch should always terminate the launch.
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
index 9e3b340d3..48ce39a3b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
@@ -10,6 +10,10 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.IRequest;
@@ -25,6 +29,7 @@ import org.eclipse.debug.ui.contexts.DebugContextEvent;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
/**
* Action which terminates a launch and then re-launches it.
@@ -48,6 +53,24 @@ public class TerminateAndRelaunchAction extends DebugCommandAction {
}
}
+ protected ISelection getContext() {
+ // Convert action context to contain only launch objects (bug 356651).
+ ISelection context = super.getContext();
+ if (context instanceof IStructuredSelection && !context.isEmpty()) {
+ IStructuredSelection ss = (IStructuredSelection)context;
+ Set launches = new HashSet(ss.size());
+ for (Iterator itr = ss.iterator(); itr.hasNext();) {
+
+ ILaunch launch = DebugUIPlugin.getLaunch(itr.next());
+ if (launch != null) {
+ launches.add(launch);
+ }
+ }
+ return new StructuredSelection(launches.toArray());
+ }
+ return super.getContext();
+ }
+
protected Class getCommandType() {
return ITerminateHandler.class;

Back to the top