Bug 573561 - Terminate/Disconnect All command does not appear in
Preferences -> Keys

Change-Id: I9b62158e708c8d41b31c0110bb1d02cc51d206b4
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.debug/+/181000
Tested-by: Lakshmi P Shanmugam <lshanmug@in.ibm.com>
Reviewed-by: Jonah Graham <jonah@kichwacoders.com>
Reviewed-by: Sarika Sinha <sarika.sinha@in.ibm.com>
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index e3a2ced..0789bdb 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -234,6 +234,9 @@
 ActionDefinition.terminateAndRelaunch.name=Terminate and Relaunch
 ActionDefinition.terminateAndRelaunch.description=Terminate and Relaunch
 
+ActionDefinition.terminateAll.name=Terminate/Disconnect All
+ActionDefinition.terminateAll.description=Terminate/Disconnect All
+
 ActionDefinition.toggleBreakpoint.name=Toggle Breakpoint
 ActionDefinition.toggleBreakpoint.description=Creates or removes a breakpoint
 ActionDefinition.toggleLineBreakpoint.name=Toggle Line Breakpoint
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index c95e631..4503dfd 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
 <!--
-     Copyright (c) 2005, 2020 IBM Corporation and others.
+     Copyright (c) 2005, 2021 IBM Corporation and others.
 
      This program and the accompanying materials
      are made available under the terms of the Eclipse Public License 2.0
@@ -1918,6 +1918,15 @@
          </defaultHandler>
       </command>
       <command
+            name="%ActionDefinition.terminateAll.name"
+            categoryId="org.eclipse.debug.ui.category.run"
+            description="%ActionDefinition.terminateAll.description"
+            id="org.eclipse.debug.ui.commands.TerminateAll">
+         <defaultHandler
+               class="org.eclipse.debug.internal.ui.commands.actions.TerminateAllHandler">
+         </defaultHandler>
+      </command>
+      <command
             name="%ActionDefinition.restart.name"
             categoryId="org.eclipse.debug.ui.category.run"
             description="%ActionDefinition.restart.description"
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllHandler.java
new file mode 100644
index 0000000..ff14fbb
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllHandler.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2021 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.commands.actions;
+
+import org.eclipse.debug.internal.ui.views.launch.LaunchView;
+
+
+/**
+ * Default handler for terminate and re-launch. See bug 300810.
+ */
+public class TerminateAllHandler extends DebugActionHandler {
+
+	public TerminateAllHandler() {
+		super(LaunchView.TERMINATE_ALL);
+	}
+
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
index d8bae0c..e7fdedc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -163,7 +163,7 @@
 
 	public static final String TERMINATE_AND_REMOVE = "terminate_and_remove"; //$NON-NLS-1$
 
-	private static final String TERMINATE_ALL = "terminate_all"; //$NON-NLS-1$
+	public static final String TERMINATE_ALL = "terminate_all"; //$NON-NLS-1$
 
 	public static final String TERMINATE_AND_RELAUNCH = "terminate_relaunch"; //$NON-NLS-1$
 
@@ -550,7 +550,9 @@
 		addCapabilityAction(action, TERMINATE_AND_RELAUNCH);
 		setHandler(TERMINATE_AND_RELAUNCH, new ActionHandler(action));
 		addCapabilityAction(new RestartCommandAction(), RESTART);
-		addCapabilityAction(new TerminateAllAction(), TERMINATE_ALL);
+		action = new TerminateAllAction();
+		addCapabilityAction(action, TERMINATE_ALL);
+		setHandler(TERMINATE_ALL, new ActionHandler(action));
 		addCapabilityAction(new ToggleStepFiltersAction(), TOGGLE_STEP_FILTERS);
 	}