Search in sources :

Example 1 with BreakpointManagerObserver

use of org.eclipse.che.ide.api.debug.BreakpointManagerObserver in project che by eclipse.

the class BreakpointManagerImpl method deleteAllBreakpoints.

@Override
public void deleteAllBreakpoints() {
    for (List<Breakpoint> pathBreakpoints : breakpoints.values()) {
        removeBreakpointsForPath(pathBreakpoints);
    }
    breakpoints.clear();
    preserveBreakpoints();
    for (BreakpointManagerObserver observer : observers) {
        observer.onAllBreakpointsDeleted();
    }
    Debugger debugger = debuggerManager.getActiveDebugger();
    if (debugger != null) {
        debugger.deleteAllBreakpoints();
    }
}
Also used : Breakpoint(org.eclipse.che.ide.api.debug.Breakpoint) BreakpointManagerObserver(org.eclipse.che.ide.api.debug.BreakpointManagerObserver)

Example 2 with BreakpointManagerObserver

use of org.eclipse.che.ide.api.debug.BreakpointManagerObserver in project che by eclipse.

the class BreakpointManagerImpl method addBreakpoint.

/**
     * Adds breakpoint to the list and JVM.
     */
private void addBreakpoint(final Breakpoint breakpoint) {
    List<Breakpoint> pathBreakpoints = breakpoints.get(breakpoint.getPath());
    if (pathBreakpoints == null) {
        pathBreakpoints = new ArrayList<>();
        breakpoints.put(breakpoint.getPath(), pathBreakpoints);
    }
    if (!pathBreakpoints.contains(breakpoint)) {
        pathBreakpoints.add(breakpoint);
    }
    preserveBreakpoints();
    final BreakpointRenderer breakpointRenderer = getBreakpointRendererForFile(breakpoint.getPath());
    if (breakpointRenderer != null) {
        breakpointRenderer.addBreakpointMark(breakpoint.getLineNumber(), new LineChangeAction() {

            @Override
            public void onLineChange(VirtualFile file, int firstLine, int linesAdded, int linesRemoved) {
                BreakpointManagerImpl.this.onLineChange(file, firstLine, linesAdded, linesRemoved);
            }
        });
        breakpointRenderer.setBreakpointActive(breakpoint.getLineNumber(), breakpoint.isActive());
    }
    for (BreakpointManagerObserver observer : observers) {
        observer.onBreakpointAdded(breakpoint);
    }
    Debugger debugger = debuggerManager.getActiveDebugger();
    if (debugger != null) {
        debugger.addBreakpoint(breakpoint.getFile(), breakpoint.getLineNumber());
    }
}
Also used : VirtualFile(org.eclipse.che.ide.api.resources.VirtualFile) Breakpoint(org.eclipse.che.ide.api.debug.Breakpoint) BreakpointRenderer(org.eclipse.che.ide.api.debug.BreakpointRenderer) HasBreakpointRenderer(org.eclipse.che.ide.api.debug.HasBreakpointRenderer) LineChangeAction(org.eclipse.che.ide.api.debug.BreakpointRenderer.LineChangeAction) BreakpointManagerObserver(org.eclipse.che.ide.api.debug.BreakpointManagerObserver) Breakpoint(org.eclipse.che.ide.api.debug.Breakpoint)

Example 3 with BreakpointManagerObserver

use of org.eclipse.che.ide.api.debug.BreakpointManagerObserver in project che by eclipse.

the class BreakpointManagerImpl method deleteBreakpoint.

/**
     * Deletes breakpoint from the list and JVM.
     * Removes breakpoint mark.
     */
private void deleteBreakpoint(final VirtualFile activeFile, final Breakpoint breakpoint) {
    doDeleteBreakpoint(breakpoint);
    for (BreakpointManagerObserver observer : observers) {
        observer.onBreakpointDeleted(breakpoint);
    }
    Debugger debugger = debuggerManager.getActiveDebugger();
    if (debugger != null) {
        debugger.deleteBreakpoint(activeFile, breakpoint.getLineNumber());
    }
}
Also used : BreakpointManagerObserver(org.eclipse.che.ide.api.debug.BreakpointManagerObserver)

Aggregations

BreakpointManagerObserver (org.eclipse.che.ide.api.debug.BreakpointManagerObserver)3 Breakpoint (org.eclipse.che.ide.api.debug.Breakpoint)2 BreakpointRenderer (org.eclipse.che.ide.api.debug.BreakpointRenderer)1 LineChangeAction (org.eclipse.che.ide.api.debug.BreakpointRenderer.LineChangeAction)1 HasBreakpointRenderer (org.eclipse.che.ide.api.debug.HasBreakpointRenderer)1 VirtualFile (org.eclipse.che.ide.api.resources.VirtualFile)1