[r3.1.2] Bug 116217 - RoS action failure in editor context menu.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java
index 4b7fb05..f31798e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java
@@ -57,14 +57,16 @@
 		if (wb != null) {
 			IWorkbenchPage page = wb.getActivePage();
 			if (page != null) {
-				ISelection selection = page.getSelection();
-				if (selection instanceof IStructuredSelection) {
-					fShortcut.launch(selection, fMode);
-				} else {
+				if (page.getActivePart() == page.getActiveEditor()) {
 					IEditorPart editor = page.getActiveEditor();
 					if (editor != null) {
 						fShortcut.launch(editor, fMode);
 					}
+				} else {
+					ISelection selection = page.getSelection();
+					if (selection instanceof IStructuredSelection) {
+						fShortcut.launch(selection, fMode);
+					}
 				}
 			}
 		}