Search in sources :

Example 86 with IRegion

use of org.eclipse.jface.text.IRegion in project bndtools by bndtools.

the class PropertiesLineReader method grabLine.

private char[] grabLine(boolean continued) throws BadLocationException {
    if (lineNum >= lineCount) {
        lastRegion = null;
        return null;
    }
    IRegion lineInfo = document.getLineInformation(lineNum);
    char[] chars = document.get(lineInfo.getOffset(), lineInfo.getLength()).toCharArray();
    if (continued) {
        int length = lastRegion.getLength();
        length += document.getLineDelimiter(lineNum - 1).length();
        length += lineInfo.getLength();
        lastRegion = new Region(lastRegion.getOffset(), length);
    } else {
        lastRegion = lineInfo;
    }
    lineNum++;
    return chars;
}
Also used : Region(org.eclipse.jface.text.Region) IRegion(org.eclipse.jface.text.IRegion) IRegion(org.eclipse.jface.text.IRegion)

Aggregations

IRegion (org.eclipse.jface.text.IRegion)86 BadLocationException (org.eclipse.jface.text.BadLocationException)41 IDocument (org.eclipse.jface.text.IDocument)15 Region (org.eclipse.jface.text.Region)15 Document (org.eclipse.jface.text.Document)8 Position (org.eclipse.jface.text.Position)8 StyledString (org.eclipse.jface.viewers.StyledString)7 IJavaProject (org.eclipse.jdt.core.IJavaProject)6 IHyperlink (org.eclipse.jface.text.hyperlink.IHyperlink)6 ArrayList (java.util.ArrayList)5 ASTNode (org.eclipse.jdt.core.dom.ASTNode)5 DefaultLineTracker (org.eclipse.jface.text.DefaultLineTracker)5 ILineTracker (org.eclipse.jface.text.ILineTracker)5 HashMap (java.util.HashMap)4 IFile (org.eclipse.core.resources.IFile)4 Point (org.eclipse.swt.graphics.Point)4 MalformedTreeException (org.eclipse.text.edits.MalformedTreeException)4 MultiTextEdit (org.eclipse.text.edits.MultiTextEdit)4 HashSet (java.util.HashSet)3 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)3