Search in sources :

Example 1 with StartActionDto

use of org.eclipse.che.api.debug.shared.dto.action.StartActionDto in project che by eclipse.

the class AbstractDebugger method startDebugger.

protected void startDebugger(final DebugSessionDto debugSessionDto) {
    List<BreakpointDto> breakpoints = new ArrayList<>();
    for (Breakpoint breakpoint : breakpointManager.getBreakpointList()) {
        LocationDto locationDto = dtoFactory.createDto(LocationDto.class).withLineNumber(breakpoint.getLineNumber() + 1).withResourcePath(breakpoint.getPath()).withResourceProjectPath(getProject(breakpoint.getFile()).getPath());
        String target = pathToFqn(breakpoint.getFile());
        if (target != null) {
            locationDto.setTarget(target);
            BreakpointDto breakpointDto = dtoFactory.createDto(BreakpointDto.class);
            breakpointDto.setLocation(locationDto);
            breakpointDto.setEnabled(true);
            breakpoints.add(breakpointDto);
        }
    }
    StartActionDto action = dtoFactory.createDto(StartActionDto.class);
    action.setType(Action.TYPE.START);
    action.setBreakpoints(breakpoints);
    service.start(debugSessionDto.getId(), action);
}
Also used : Breakpoint(org.eclipse.che.ide.api.debug.Breakpoint) ArrayList(java.util.ArrayList) BreakpointDto(org.eclipse.che.api.debug.shared.dto.BreakpointDto) LocationDto(org.eclipse.che.api.debug.shared.dto.LocationDto) StartActionDto(org.eclipse.che.api.debug.shared.dto.action.StartActionDto)

Aggregations

ArrayList (java.util.ArrayList)1 BreakpointDto (org.eclipse.che.api.debug.shared.dto.BreakpointDto)1 LocationDto (org.eclipse.che.api.debug.shared.dto.LocationDto)1 StartActionDto (org.eclipse.che.api.debug.shared.dto.action.StartActionDto)1 Breakpoint (org.eclipse.che.ide.api.debug.Breakpoint)1