public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection)
throws CoreException {
- IEditorPart editorPart = (IEditorPart) part;
+ IEditorPart editorPart = (IEditorPart)part;
- IResource resource = (IResource) editorPart.getEditorInput()
- .getAdapter(IResource.class);
+ IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
ITextSelection textSelection = (ITextSelection) selection;
- int lineNumber = textSelection.getStartLine() + 1;
- IBreakpoint[] breakpoints = DebugPlugin.getDefault()
- .getBreakpointManager().getBreakpoints(
- IXDebugConstants.ID_PHP_DEBUG_MODEL);
+ int lineNumber = textSelection.getStartLine()+1;
+ IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IXDebugConstants.ID_PHP_BREAKPOINT_MODEL);
for (int i = 0; i < breakpoints.length; i++) {
IBreakpoint breakpoint = breakpoints[i];
if (resource.equals(breakpoint.getMarker().getResource())) {
- if (((ILineBreakpoint) breakpoint).getLineNumber() == (lineNumber)) {
- // remove
+ if (((ILineBreakpoint)breakpoint).getLineNumber() == (lineNumber )) {
+ // remove
breakpoint.delete();
return;
}
}
}
- // create line breakpoint (doc line numbers start at 0)
- XDebugLineBreakpoint lineBreakpoint = new XDebugLineBreakpoint(
- resource, lineNumber);
- // DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(lineBreakpoint);
-
+ // create line breakpoint (doc line numbers start at 0)
+ XDebugLineBreakpoint lineBreakpoint = new XDebugLineBreakpoint(resource, lineNumber);
+ DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(lineBreakpoint);
+
}
public boolean canToggleLineBreakpoints(IWorkbenchPart part,