Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupElementLaunchedHandler.java')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupElementLaunchedHandler.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupElementLaunchedHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupElementLaunchedHandler.java
new file mode 100644
index 000000000..24d276ce9
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupElementLaunchedHandler.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2016 SSI Schaefer and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * SSI Schaefer - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.groups;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.IStatusHandler;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+
+/**
+ * Handles additionally required actions when a member of a group has been
+ * launched
+ *
+ * @since 3.12
+ */
+public class GroupElementLaunchedHandler implements IStatusHandler {
+
+ @Override
+ public Object handleStatus(IStatus status, Object source) throws CoreException {
+ if (source instanceof ILaunch[]) {
+ ILaunch[] launches = (ILaunch[]) source;
+
+ // Now we need to override the history to make multi-launch
+ // appear last, if we don't do it last launch would be our
+ // child's launch which is not correct for repeating the
+ // experience.
+ DebugUIPlugin.getDefault().getLaunchConfigurationManager().setRecentLaunch(launches[0]);
+ }
+ return null;
+ }
+
+}

Back to the top