Search in sources :

Example 11 with XBreakpoint

use of com.intellij.xdebugger.breakpoints.XBreakpoint in project intellij-community by JetBrains.

the class PyExceptionBreakpointType method addBreakpoint.

@Override
public XBreakpoint<PyExceptionBreakpointProperties> addBreakpoint(final Project project, JComponent parentComponent) {
    final PyClassTreeChooserDialog dialog = new PyClassTreeChooserDialog("Select Exception Class", project, GlobalSearchScope.allScope(project), new PyExceptionCachingFilter(), null);
    dialog.showDialog();
    // on ok
    final PyClass pyClass = dialog.getSelected();
    if (pyClass != null) {
        final String qualifiedName = pyClass.getQualifiedName();
        assert qualifiedName != null : "Qualified name of the class shouldn't be null";
        return ApplicationManager.getApplication().runWriteAction(new Computable<XBreakpoint<PyExceptionBreakpointProperties>>() {

            @Override
            public XBreakpoint<PyExceptionBreakpointProperties> compute() {
                return XDebuggerManager.getInstance(project).getBreakpointManager().addBreakpoint(PyExceptionBreakpointType.this, new PyExceptionBreakpointProperties(qualifiedName));
            }
        });
    }
    return null;
}
Also used : PyClass(com.jetbrains.python.psi.PyClass) XBreakpoint(com.intellij.xdebugger.breakpoints.XBreakpoint)

Aggregations

XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)11 Breakpoint (com.intellij.debugger.ui.breakpoints.Breakpoint)2 XLineBreakpoint (com.intellij.xdebugger.breakpoints.XLineBreakpoint)2 DebuggerCommandImpl (com.intellij.debugger.engine.events.DebuggerCommandImpl)1 SuspendContextCommandImpl (com.intellij.debugger.engine.events.SuspendContextCommandImpl)1 LocatableEventRequestor (com.intellij.debugger.engine.requests.LocatableEventRequestor)1 StackCapturingLineBreakpoint (com.intellij.debugger.ui.breakpoints.StackCapturingLineBreakpoint)1 TreeClassChooser (com.intellij.ide.util.TreeClassChooser)1 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 PsiClass (com.intellij.psi.PsiClass)1 SmartList (com.intellij.util.SmartList)1 XDebugSession (com.intellij.xdebugger.XDebugSession)1 XBreakpointAdapter (com.intellij.xdebugger.breakpoints.XBreakpointAdapter)1 XBreakpointManager (com.intellij.xdebugger.breakpoints.XBreakpointManager)1 XBreakpointType (com.intellij.xdebugger.breakpoints.XBreakpointType)1 XBreakpointBase (com.intellij.xdebugger.impl.breakpoints.XBreakpointBase)1 XLightBreakpointPropertiesPanel (com.intellij.xdebugger.impl.breakpoints.ui.XLightBreakpointPropertiesPanel)1 PyClass (com.jetbrains.python.psi.PyClass)1 InternalException (com.sun.jdi.InternalException)1 ThreadReference (com.sun.jdi.ThreadReference)1