diff --git a/org.eclipse.jdt.debug.ui/plugin.properties b/org.eclipse.jdt.debug.ui/plugin.properties
index a05fd27241..6a32ed29af 100644
--- a/org.eclipse.jdt.debug.ui/plugin.properties
+++ b/org.eclipse.jdt.debug.ui/plugin.properties
@@ -267,6 +267,9 @@ javaLikeExtensions.description=Regular expression matching registered Java-like
Context.javaDebugging.name= Debugging Java
Context.javaDebugging.description= Debugging Java programs
+Context.javaConsoleScope.name= In Java Stack Trace Console
+Context.javaConsoleScope.description= Editing Java stack traces
+
newWizardCategoryName=Java Run/Debug
NewJavaScrapbookPage.label= Scrapbook Page
NewJavaScrapbookPage.description=Create a Java scrapbook page file
diff --git a/org.eclipse.jdt.debug.ui/plugin.xml b/org.eclipse.jdt.debug.ui/plugin.xml
index 668b05985d..e00dc4cde6 100644
--- a/org.eclipse.jdt.debug.ui/plugin.xml
+++ b/org.eclipse.jdt.debug.ui/plugin.xml
@@ -3395,6 +3395,20 @@ M4 = Platform-specific fourth key
id="org.eclipse.jdt.debug.ui.debugging"
parentId="org.eclipse.debug.ui.debugging">
+
+
+
+
+
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTracePageParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTracePageParticipant.java
index a46005dbbb..3d3edcde65 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTracePageParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTracePageParticipant.java
@@ -35,6 +35,14 @@
*/
public class JavaStackTracePageParticipant implements IConsolePageParticipant {
+ /**
+ * Dedicated context activated while a Java stack trace console page is showing, used only to enable the Format command's key binding (see
+ * jdt.debug.ui's plugin.xml). This is intentionally not the shared "org.eclipse.jdt.ui.javaEditorScope"/"org.eclipse.ui.textEditorScope"
+ * context: activating those would also make unrelated generic text/java editor key bindings (e.g. the zoom in/out commands) take priority over
+ * this console's own key bindings while it is showing.
+ */
+ private static final String JAVA_CONSOLE_SCOPE = "org.eclipse.jdt.debug.ui.javaConsoleScope"; //$NON-NLS-1$
+
private CloseConsoleAction fCloseAction;
private FormatStackTraceActionDelegate fFormatAction;
private IHandlerActivation fHandlerActivation;
@@ -88,8 +96,13 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
fHandlerActivation = handlerService.activateHandler("org.eclipse.jdt.ui.edit.text.java.format", formatHandler); //$NON-NLS-1$
+ // Activate our own dedicated context (rather than the shared java/text
+ // editor scope) so that the Format command's Ctrl+Shift+F key binding
+ // works here, without dragging in unrelated generic editor key bindings
+ // (e.g. zoom in/out) that would otherwise take priority over this
+ // console's own key bindings while it is showing.
IContextService contextService = workbench.getAdapter(IContextService.class);
- fContextActivation = contextService.activateContext("org.eclipse.jdt.ui.javaEditorScope"); //$NON-NLS-1$
+ fContextActivation = contextService.activateContext(JAVA_CONSOLE_SCOPE);
}
/* (non-Javadoc)