use of org.springframework.ide.vscode.commons.util.BadLocationException in project sts4 by spring-projects.
the class ListLineTracker method getLineOffset.
@Override
public final int getLineOffset(int line) throws BadLocationException {
int lines = fLines.size();
if (line < 0 || line > lines)
throw new BadLocationException();
if (lines == 0)
return 0;
if (line == lines) {
Line l = fLines.get(line - 1);
if (l.delimiter != null)
return l.offset + l.length;
throw new BadLocationException();
}
Line l = fLines.get(line);
return l.offset;
}
use of org.springframework.ide.vscode.commons.util.BadLocationException in project sts4 by spring-projects.
the class ListLineTracker method getLineLength.
@Override
public final int getLineLength(int line) throws BadLocationException {
int lines = fLines.size();
if (line < 0 || line > lines)
throw new BadLocationException();
if (lines == 0 || lines == line)
return 0;
Line l = fLines.get(line);
return l.length;
}
use of org.springframework.ide.vscode.commons.util.BadLocationException in project sts4 by spring-projects.
the class ListLineTracker method getLineInformation.
@Override
public final IRegion getLineInformation(int line) throws BadLocationException {
int lines = fLines.size();
if (line < 0 || line > lines)
throw new BadLocationException();
if (lines == 0)
return new Line(0, 0);
if (line == lines) {
Line l = fLines.get(line - 1);
return new Line(l.offset + l.length, 0);
}
Line l = fLines.get(line);
return (l.delimiter != null ? new Line(l.offset, l.length - l.delimiter.length()) : l);
}
Aggregations