Search in sources :

Example 6 with RegionImpl

use of org.eclipse.che.ide.api.editor.text.RegionImpl in project che by eclipse.

the class ListLineTracker method getLineInformationOfOffset.

/* @see org.eclipse.jface.text.ILineTracker#getLineInformationOfOffset(int) */
public final Region getLineInformationOfOffset(int position) throws BadLocationException {
    if (position > fTextLength)
        throw new BadLocationException();
    if (position == fTextLength) {
        int size = fLines.size();
        if (size == 0)
            return new RegionImpl(0, 0);
        Line l = (Line) fLines.get(size - 1);
        return (l.delimiter != null ? new Line(fTextLength, 0) : new Line(fTextLength - l.length, l.length));
    }
    return getLineInformation(findLine(position));
}
Also used : RegionImpl(org.eclipse.che.ide.api.editor.text.RegionImpl) BadLocationException(org.eclipse.che.ide.api.editor.text.BadLocationException)

Aggregations

RegionImpl (org.eclipse.che.ide.api.editor.text.RegionImpl)6 BadLocationException (org.eclipse.che.ide.api.editor.text.BadLocationException)2 Region (org.eclipse.che.ide.api.editor.text.Region)2 MatchResult (com.google.gwt.regexp.shared.MatchResult)1 TypedRegion (org.eclipse.che.ide.api.editor.text.TypedRegion)1 OrionSelectionOverlay (org.eclipse.che.ide.editor.orion.client.jso.OrionSelectionOverlay)1