Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2009-11-09 15:15:16 +0000
committerMichael Rennie2009-11-09 15:15:16 +0000
commitce0308df3b5c2100052c9cefa20b356ef393eab6 (patch)
tree2e821348cfbbdd3815e922d8b2941fe543c7f3cd
parent1d49d5d761127ad2c58a324d9fc0f430b6ee17e9 (diff)
downloadeclipse.platform.debug-ce0308df3b5c2100052c9cefa20b356ef393eab6.tar.gz
eclipse.platform.debug-ce0308df3b5c2100052c9cefa20b356ef393eab6.tar.xz
eclipse.platform.debug-ce0308df3b5c2100052c9cefa20b356ef393eab6.zip
Bug 76353 - [launching] Ctrl+click on debug or run toolbar button should open launch config for editing
-rw-r--r--org.eclipse.debug.core/buildnotes_platform-debug.html13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java34
2 files changed, 44 insertions, 3 deletions
diff --git a/org.eclipse.debug.core/buildnotes_platform-debug.html b/org.eclipse.debug.core/buildnotes_platform-debug.html
index b31f93f0a..2d51f007c 100644
--- a/org.eclipse.debug.core/buildnotes_platform-debug.html
+++ b/org.eclipse.debug.core/buildnotes_platform-debug.html
@@ -11,6 +11,17 @@
<h2>Summary of API changes in 3.6</h2>
+<h3>AbstractLaunchHistoryAction</h3>
+<p><strong>What is affected:</strong>
+<ul>
+ <li>Method addition: <code>public void runWithEvent(IAction action, Event event)</code> </li>
+ <li>Method addition: <code>public void init(IAction action)</code> </li>
+ <li>Implemented Interface: <code>org.eclipse.ui.IActionDelegate2</code></li>
+</ul>
+<p><strong>Description: </strong>The implementation of <code>org.eclipse.ui.IActionDelegate2</code> and the addition of the two implemented
+methods allows for the Ctrl key modifier to be used to open the last launched launch configuration when clicking on any launch history action.
+<p><strong>Action required:</strong> This is a backwards compatible change. No action required. </p>
+
<h3>ILaunchManager and LaunchManager base class</h3>
<p><strong>What is affected:</strong>
<ul>
@@ -29,7 +40,7 @@ the method makes an effort to correct the name in one of two ways:
</p>
<p>
<strong>Description:</strong> The <code>isValidLaunchConfigurationName(String configname)</code> method is used to validate the specified configuration name and throws an <code>IllegalArgumentException</code>. This method provides
-the validation forthe <code>generateLaunchConfigurationName(String namePrefix)</code> method.</p>
+the validation for the <code>generateLaunchConfigurationName(String namePrefix)</code> method.</p>
<p><strong>Action required:</strong> This is a backwards compatible change. No action required. </p>
<p><strong>Description:</strong> The <code>ATTR_PRIVATE</code> constant is a launch configuration attribute key used to identify whether a launch configuration should appear in the debug user interface (launch history, launch dialog, etc.). The value is a boolean. This attribute was previously defined in the debug UI plug-in, but was moved to core for headless plug-is that need to specify a value for this attribute. </p>
<p><strong>Action required:</strong> This is a backwards compatible change. No action required. </p>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
index b0edd294d..0824e9a10 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM Corporation 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
@@ -23,17 +23,21 @@ import org.eclipse.debug.internal.ui.actions.ActionMessages;
import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory;
+import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.ILaunchGroup;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MenuAdapter;
import org.eclipse.swt.events.MenuEvent;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IActionDelegate2;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
@@ -49,7 +53,7 @@ import com.ibm.icu.text.MessageFormat;
* @see ILaunchLabelChangedListener
* @since 2.1
*/
-public abstract class AbstractLaunchHistoryAction implements IWorkbenchWindowPulldownDelegate2, ILaunchHistoryChangedListener {
+public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, IWorkbenchWindowPulldownDelegate2, ILaunchHistoryChangedListener {
/**
* The menu created by this action
@@ -362,8 +366,34 @@ public abstract class AbstractLaunchHistoryAction implements IWorkbenchWindowPul
public void run(IAction action) {
// do nothing - this is just a menu
}
+
+ /**
+ * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
+ * @since 3.6
+ */
+ public void runWithEvent(IAction action, Event event) {
+ if(event.stateMask == SWT.MOD1) {
+ ILaunchConfiguration config = getLastLaunch();
+ if(config != null) {
+ DebugUITools.openLaunchConfigurationDialogOnGroup(
+ DebugUIPlugin.getShell(),
+ new StructuredSelection(config),
+ getLaunchGroupIdentifier());
+ return;
+ }
+ }
+ run(action);
+ }
/**
+ * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
+ * @since 3.6
+ */
+ public void init(IAction action) {
+ // do nothing by default
+ }
+
+ /**
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
public void selectionChanged(IAction action, ISelection selection){

Back to the top