diff options
author | Michael Rennie | 2007-12-06 17:39:47 +0000 |
---|---|---|
committer | Michael Rennie | 2007-12-06 17:39:47 +0000 |
commit | 892c97774b37e0f44c9ec5d7dd1ad4d8408601b2 (patch) | |
tree | a8eb8bc968d4c526e532a75a8d53f7664cbf2069 /org.eclipse.debug.ui | |
parent | dcb51d24e918d80eef57db657d751fb2fd0b997b (diff) | |
download | eclipse.platform.debug-892c97774b37e0f44c9ec5d7dd1ad4d8408601b2.tar.gz eclipse.platform.debug-892c97774b37e0f44c9ec5d7dd1ad4d8408601b2.tar.xz eclipse.platform.debug-892c97774b37e0f44c9ec5d7dd1ad4d8408601b2.zip |
Bug 212145 [launching] Selection cannot be launched and there are no recent launches
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java index a0d4bcf2c..b40f8eda1 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java @@ -77,14 +77,8 @@ public final class ContextRunner { */ public void launch(ILaunchGroup group) { IStructuredSelection selection = SelectedResourceManager.getDefault().getCurrentSelection(); - String mode = group.getMode(); - List shortcuts = fLRM.getShortcutsForSelection(selection, mode); IResource resource = SelectedResourceManager.getDefault().getSelectedResource(); - if(resource == null) { - resource = fLRM.getLaunchableResource(shortcuts, selection); - } - shortcuts = fLRM.pruneShortcuts(shortcuts, resource, mode); - selectAndLaunch(resource, group, shortcuts, selection); + selectAndLaunch(resource, group, selection); } @@ -113,10 +107,15 @@ public final class ContextRunner { * @param resource * @param group */ - protected void selectAndLaunch(IResource resource, ILaunchGroup group, List shortcuts, IStructuredSelection selection) { + protected void selectAndLaunch(IResource resource, ILaunchGroup group, IStructuredSelection selection) { if(group != null) { LaunchConfigurationManager lcm = DebugUIPlugin.getDefault().getLaunchConfigurationManager(); String mode = group.getMode(); + List shortcuts = fLRM.getShortcutsForSelection(selection, mode); + if(resource == null) { + resource = fLRM.getLaunchableResource(shortcuts, selection); + } + shortcuts = fLRM.pruneShortcuts(shortcuts, resource, mode); //see if the context is a shared configuration ILaunchConfiguration config = lcm.isSharedConfig(resource); if(config != null) { @@ -158,10 +157,7 @@ public final class ContextRunner { if(resource != null) { IProject project = resource.getProject(); if(project != null && !project.equals(resource)) { - IStructuredSelection projectSelection = new StructuredSelection(project); - List projectShortcuts = fLRM.getShortcutsForSelection(projectSelection, mode); - projectShortcuts = fLRM.pruneShortcuts(projectShortcuts, project, mode); - selectAndLaunch(project, group, projectShortcuts, projectSelection); + selectAndLaunch(project, group, new StructuredSelection(project)); } else { String msg = ContextMessages.ContextRunner_7; |