From ce0308df3b5c2100052c9cefa20b356ef393eab6 Mon Sep 17 00:00:00 2001 From: Michael Rennie Date: Mon, 9 Nov 2009 15:15:16 +0000 Subject: Bug 76353 - [launching] Ctrl+click on debug or run toolbar button should open launch config for editing --- .../buildnotes_platform-debug.html | 13 ++++++++- .../ui/actions/AbstractLaunchHistoryAction.java | 34 ++++++++++++++++++++-- 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 @@
What is affected: +
public void runWithEvent(IAction action, Event event)
public void init(IAction action)
org.eclipse.ui.IActionDelegate2
Description: The implementation of org.eclipse.ui.IActionDelegate2
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.
+
Action required: This is a backwards compatible change. No action required.
+What is affected:
Description: The isValidLaunchConfigurationName(String configname)
method is used to validate the specified configuration name and throws an IllegalArgumentException
. This method provides
-the validation forthe generateLaunchConfigurationName(String namePrefix)
method.
generateLaunchConfigurationName(String namePrefix)
method.
Action required: This is a backwards compatible change. No action required.
Description: The ATTR_PRIVATE
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.
Action required: This is a backwards compatible change. No action required.
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,7 +366,33 @@ 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) */ -- cgit v1.2.3