Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2006-08-01 13:37:21 -0400
committerDarin Wright2006-08-01 13:37:21 -0400
commit0ccbc4cf94ee28a83ee51fc62ddb72e1c2743a42 (patch)
treea722a4e5c5cd43bda16fb8775e76e3cb9d90d4f1
parent606d28c635655b0d801741ff5a61ebee4c38b5db (diff)
downloadeclipse.platform.debug-0ccbc4cf94ee28a83ee51fc62ddb72e1c2743a42.tar.gz
eclipse.platform.debug-0ccbc4cf94ee28a83ee51fc62ddb72e1c2743a42.tar.xz
eclipse.platform.debug-0ccbc4cf94ee28a83ee51fc62ddb72e1c2743a42.zip
Bug 74854 [breakpoints] Ctrl+B should set a method breakpoint if invoked from the method signature
-rw-r--r--org.eclipse.debug.ui/plugin.properties7
-rw-r--r--org.eclipse.debug.ui/plugin.xml12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java49
3 files changed, 64 insertions, 4 deletions
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index 507a22d42..e9de2f449 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -108,7 +108,8 @@ StepReturnAction.label=Step Ret&urn
StringVariablePresentationsName=String Variable Presentations
SuspendAction.label=&Suspend
TerminateAction.label=&Terminate
-ToggleBreakpointAction.label=Toggle Line Brea&kpoint
+ToggleBreakpointAction.label=Toggle Brea&kpoint
+ToggleLineBreakpointAction.label=Toggle &Line Breakpoint
ToggleMethodBreakpointAction.label=Toggle &Method Breakpoint
ToggleWatchpointAction.label=Toggle &Watchpoint
VariablesView.name=Variables
@@ -190,8 +191,8 @@ ActionDefinition.terminate.description=Terminate
ActionDefinition.terminateAndRelaunch.name=Terminate and Relaunch
ActionDefinition.terminateAndRelaunch.description=Terminate and Relaunch
-ActionDefinition.toggleBreakpoint.name=Toggle Line Breakpoint
-ActionDefinition.toggleBreakpoint.description=Creates or removes a line breakpoint
+ActionDefinition.toggleBreakpoint.name=Toggle Breakpoint
+ActionDefinition.toggleBreakpoint.description=Creates or removes a breakpoint
ActionDefinition.suspend.name=Suspend
ActionDefinition.suspend.description=Suspend
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index 6d26de398..01a723abf 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -439,12 +439,22 @@
id="org.eclipse.debug.ui.actions.ToggleMethodBreakpoint">
</action>
<action
+ definitionId="org.eclipse.debug.ui.commands.ToggleLineBreakpoint"
+ label="%ToggleLineBreakpointAction.label"
+ icon="$nl$/icons/full/obj16/brkp_obj.gif"
+ disabledIcon="$nl$/icons/full/obj16/brkpd_obj.gif"
+ helpContextId="toggle_line_breakpoint_action_context"
+ class="org.eclipse.debug.internal.ui.actions.breakpoints.RetargetToggleLineBreakpointAction"
+ menubarPath="org.eclipse.ui.run/breakpointGroup"
+ id="org.eclipse.debug.ui.actions.ToggleLineBreakpoint">
+ </action>
+ <action
definitionId="org.eclipse.debug.ui.commands.ToggleBreakpoint"
label="%ToggleBreakpointAction.label"
icon="$nl$/icons/full/obj16/brkp_obj.gif"
disabledIcon="$nl$/icons/full/obj16/brkpd_obj.gif"
helpContextId="toggle_breakpoint_action_context"
- class="org.eclipse.debug.internal.ui.actions.breakpoints.RetargetToggleLineBreakpointAction"
+ class="org.eclipse.debug.internal.ui.actions.breakpoints.RetargetToggleBreakpointAction"
menubarPath="org.eclipse.ui.run/breakpointGroup"
id="org.eclipse.debug.ui.actions.ToggleBreakpoint">
</action>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java
new file mode 100644
index 000000000..f83aec9e1
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.actions.breakpoints;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
+import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IWorkbenchPart;
+
+
+/**
+ * Global retargettable toggle breakpoint action.
+ *
+ * @since 3.3
+ */
+public class RetargetToggleBreakpointAction extends RetargetBreakpointAction {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
+ */
+ protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
+ if (target instanceof IToggleBreakpointsTargetExtension) {
+ IToggleBreakpointsTargetExtension ext = (IToggleBreakpointsTargetExtension) target;
+ ext.toggleBreakpoints(part, selection);
+ } else {
+ ((IToggleBreakpointsTarget)target).toggleLineBreakpoints(part, selection);
+ }
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
+ */
+ protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
+ if (target instanceof IToggleBreakpointsTargetExtension) {
+ IToggleBreakpointsTargetExtension ext = (IToggleBreakpointsTargetExtension) target;
+ return ext.canToggleBreakpoints(part, selection);
+ } else {
+ return ((IToggleBreakpointsTarget)target).canToggleLineBreakpoints(part, selection);
+ }
+ }
+}

Back to the top