use of org.eclipse.che.ide.api.debug.BreakpointRenderer in project che by eclipse.
the class BreakpointManagerImpl method doDeleteBreakpoint.
/**
* Deletes breakpoint from the list.
*/
private void doDeleteBreakpoint(Breakpoint breakpoint) {
BreakpointRenderer breakpointRenderer = getBreakpointRendererForFile(breakpoint.getPath());
if (breakpointRenderer != null) {
breakpointRenderer.removeBreakpointMark(breakpoint.getLineNumber());
}
String path = breakpoint.getPath();
List<Breakpoint> pathBreakpoints = breakpoints.get(path);
if (pathBreakpoints != null) {
pathBreakpoints.remove(breakpoint);
if (pathBreakpoints.isEmpty()) {
breakpoints.remove(breakpoint.getPath());
}
}
preserveBreakpoints();
}
use of org.eclipse.che.ide.api.debug.BreakpointRenderer in project che by eclipse.
the class BreakpointManagerImpl method onBreakpointAdded.
@Override
public void onBreakpointAdded(Breakpoint breakpoint) {
String path = breakpoint.getPath();
List<Breakpoint> breakpointsForPath = breakpoints.get(path);
if (breakpointsForPath == null) {
breakpointsForPath = new ArrayList<>();
breakpoints.put(path, breakpointsForPath);
}
int i = breakpointsForPath.indexOf(breakpoint);
if (i == -1) {
breakpointsForPath.add(breakpoint);
} else {
breakpointsForPath.set(i, breakpoint);
}
BreakpointRenderer breakpointRenderer = getBreakpointRendererForFile(breakpoint.getPath());
if (breakpointRenderer != null) {
breakpointRenderer.setBreakpointActive(breakpoint.getLineNumber(), breakpoint.isActive());
}
preserveBreakpoints();
}
use of org.eclipse.che.ide.api.debug.BreakpointRenderer in project che by eclipse.
the class BreakpointManagerImpl method onBreakpointActivated.
@Override
public void onBreakpointActivated(String filePath, int lineNumber) {
List<Breakpoint> breakpointsForPath = breakpoints.get(filePath);
if (breakpointsForPath == null) {
return;
}
for (int i = 0; i < breakpointsForPath.size(); i++) {
Breakpoint breakpoint = breakpointsForPath.get(i);
if (breakpoint.getLineNumber() == lineNumber) {
Breakpoint newActiveBreakpoint = new Breakpoint(breakpoint.getType(), breakpoint.getLineNumber(), breakpoint.getPath(), breakpoint.getFile(), true);
breakpointsForPath.set(i, newActiveBreakpoint);
preserveBreakpoints();
BreakpointRenderer breakpointRenderer = getBreakpointRendererForFile(breakpoint.getPath());
if (breakpointRenderer != null) {
breakpointRenderer.setBreakpointActive(breakpoint.getLineNumber(), true);
}
}
}
}
use of org.eclipse.che.ide.api.debug.BreakpointRenderer in project che by eclipse.
the class BreakpointManagerImpl method doSetCurrentBreakpoint.
private void doSetCurrentBreakpoint(VirtualFile activeFile, int lineNumber) {
currentBreakpoint = new Breakpoint(Type.CURRENT, lineNumber, activeFile.getLocation().toString(), activeFile, true);
BreakpointRenderer breakpointRenderer = getBreakpointRendererForFile(activeFile.getLocation().toString());
if (breakpointRenderer != null) {
breakpointRenderer.setLineActive(lineNumber, true);
}
preserveBreakpoints();
}
use of org.eclipse.che.ide.api.debug.BreakpointRenderer in project che by eclipse.
the class BreakpointManagerImpl method deleteCurrentBreakpoint.
public void deleteCurrentBreakpoint() {
if (currentBreakpoint != null) {
int oldLineNumber = currentBreakpoint.getLineNumber();
BreakpointRenderer breakpointRenderer = getBreakpointRendererForFile(currentBreakpoint.getPath());
if (breakpointRenderer != null) {
breakpointRenderer.setLineActive(oldLineNumber, false);
}
currentBreakpoint = null;
}
preserveBreakpoints();
}
Aggregations