Search in sources :

Example 1 with ClojureLineBreakpoint

use of org.enclojure.ide.debugger.breakpoints.ClojureLineBreakpoint in project enclojure by EricThorsen.

the class ClojureToggleBreakpointActionProvider method doAction.

public void doAction(Object action) {
    DebuggerManager d = DebuggerManager.getDebuggerManager();
    // 1) get source name & line number
    int ln = Context.getCurrentLineNumber();
    String url = Context.getCurrentURL();
    if (url == null)
        return;
    // 2) find and remove existing line breakpoint
    ClojureLineBreakpoint lb = getClojureBreakpointAnnotationListener().findBreakpoint(url, ln);
    if (lb != null) {
        d.removeBreakpoint(lb);
        return;
    }
    lb = ClojureLineBreakpoint.create(url, ln, debugger, engineContext, session, breakpointsReader);
    d.addBreakpoint(lb);
}
Also used : ClojureLineBreakpoint(org.enclojure.ide.debugger.breakpoints.ClojureLineBreakpoint) ClojureLineBreakpoint(org.enclojure.ide.debugger.breakpoints.ClojureLineBreakpoint)

Example 2 with ClojureLineBreakpoint

use of org.enclojure.ide.debugger.breakpoints.ClojureLineBreakpoint in project enclojure by EricThorsen.

the class Context method annotate.

/**
 * Adds annotation to url:line where the given breakpoint is set.
 *
 * @param b breakpoint to annotate
 *
 * @return annotation or <code>null</code>, when the annotation can not be
 *         created at the url:line where the given breakpoint is set.
 */
public static Object annotate(ClojureLineBreakpoint b) {
    String url = b.getURL();
    int lineNumber = b.getLineNumber();
    if (lineNumber < 1)
        return null;
    String condition = b.getCondition();
    boolean isConditional = (condition != null) && // NOI18N
    !condition.trim().equals("");
    String annotationType = b.isEnabled() ? (isConditional ? EditorContext.CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE : EditorContext.BREAKPOINT_ANNOTATION_TYPE) : (isConditional ? EditorContext.DISABLED_CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_BREAKPOINT_ANNOTATION_TYPE);
    return annotate(url, lineNumber, annotationType, null);
}
Also used : ClojureLineBreakpoint(org.enclojure.ide.debugger.breakpoints.ClojureLineBreakpoint)

Aggregations

ClojureLineBreakpoint (org.enclojure.ide.debugger.breakpoints.ClojureLineBreakpoint)2