aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Georgi2012-02-21 15:06:10 (EST)
committerMike Rennie2012-02-21 15:07:15 (EST)
commitf8db67f5e6ef22a2768e856d60a653b792f02385 (patch)
tree9607a47ba46ede2af405363aa59d4b9f53f329ea
parentaa357e78b41e87b7d414d1a7d0b8b7db0dfce011 (diff)
downloadeclipse.platform.debug-f8db67f5e6ef22a2768e856d60a653b792f02385.zip
eclipse.platform.debug-f8db67f5e6ef22a2768e856d60a653b792f02385.tar.gz
eclipse.platform.debug-f8db67f5e6ef22a2768e856d60a653b792f02385.tar.bz2
Bug 371981 - Make IToggleBreakpointsTargetExtension2 usable for clientsv20120221-2007
compiled against older Eclipse versions
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension2.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java15
2 files changed, 10 insertions, 7 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension2.java
index 6bec456..7d3c0ce 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension2.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension2.java
@@ -22,7 +22,7 @@ import org.eclipse.ui.IWorkbenchPart;
* when the user double-clicks in the vertical ruler.
* <p>
* Clients implementing <code>IToggleBreakpointsTarget</code> or <code>IToggleBreakpointsTargetExtension</code> may optionally
- * implement this interface.
+ * implement or adapt to this interface.
* </p>
* @since 3.8
* @see org.eclipse.debug.ui.actions.ToggleBreakpointAction
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
index 30624bd..d15da73 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
@@ -12,6 +12,7 @@
package org.eclipse.debug.ui.actions;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.actions.ActionMessages;
import org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager;
@@ -103,17 +104,19 @@ public class ToggleBreakpointAction extends Action implements IUpdate {
ITextSelection selection = getTextSelection(document, line);
IToggleBreakpointsTarget target = DebugUITools.getToggleBreakpointsTargetManager().getToggleBreakpointsTarget(fPart, selection);
if (target != null) {
- if(target instanceof IToggleBreakpointsTargetExtension2) {
- IToggleBreakpointsTargetExtension2 ext = (IToggleBreakpointsTargetExtension2) target;
+ IToggleBreakpointsTargetExtension2 ext = (IToggleBreakpointsTargetExtension2)
+ DebugPlugin.getAdapter(target, IToggleBreakpointsTargetExtension2.class);
+ if (ext != null) {
if(ext.canToggleBreakpointsWithEvent(fPart, selection, event)) {
ext.toggleBreakpointsWithEvent(fPart, selection, event);
return;
}
}
- if (target instanceof IToggleBreakpointsTargetExtension) {
- IToggleBreakpointsTargetExtension extension = (IToggleBreakpointsTargetExtension) target;
- if (extension.canToggleBreakpoints(fPart, selection)) {
- extension.toggleBreakpoints(fPart, selection);
+ IToggleBreakpointsTargetExtension ext2 = (IToggleBreakpointsTargetExtension)
+ DebugPlugin.getAdapter(target, IToggleBreakpointsTargetExtension.class);
+ if(ext2 != null) {
+ if (ext2.canToggleBreakpoints(fPart, selection)) {
+ ext2.toggleBreakpoints(fPart, selection);
return;
}
}