mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Bug 293634 - [breakpoints] ToggleBreakpointAdapter blocks UI thread waiting on the index (follow up)
This commit is contained in:
parent
ab53de8c4f
commit
2d40e6fea7
1 changed files with 24 additions and 2 deletions
|
@ -51,7 +51,7 @@ import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.debug.core.DebugPlugin;
|
import org.eclipse.debug.core.DebugPlugin;
|
||||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
|
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
|
||||||
import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
|
import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension;
|
||||||
import org.eclipse.jface.text.IDocument;
|
import org.eclipse.jface.text.IDocument;
|
||||||
import org.eclipse.jface.text.ITextSelection;
|
import org.eclipse.jface.text.ITextSelection;
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
|
@ -68,7 +68,7 @@ import org.eclipse.ui.texteditor.ITextEditor;
|
||||||
/**
|
/**
|
||||||
* Toggles a line breakpoint in a C/C++ editor.
|
* Toggles a line breakpoint in a C/C++ editor.
|
||||||
*/
|
*/
|
||||||
public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
|
public class ToggleBreakpointAdapter implements IToggleBreakpointsTargetExtension {
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
|
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
|
||||||
|
@ -539,4 +539,26 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
|
||||||
}
|
}
|
||||||
return adapter;
|
return adapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension#canToggleBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
|
||||||
|
*/
|
||||||
|
public boolean canToggleBreakpoints(IWorkbenchPart part, ISelection selection) {
|
||||||
|
return canToggleLineBreakpoints(part, selection);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension#toggleBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
|
||||||
|
*/
|
||||||
|
public void toggleBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
|
||||||
|
ICElement element = getCElementFromSelection(part, selection);
|
||||||
|
if (element instanceof IFunction || element instanceof IMethod) {
|
||||||
|
toggleMethodBreakpoints0((IDeclaration)element);
|
||||||
|
} else if (element instanceof IVariable) {
|
||||||
|
toggleVariableWatchpoint(part, (IVariable) element);
|
||||||
|
} else {
|
||||||
|
toggleLineBreakpoints(part, selection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue