Java 8 DocumentRange - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 DocumentRange class.

This code example shows how to use the following methods:createRange
 
    public Range getSelectionRange() {
        if (this.dotInfo == null || this.dotInfo.range == null) {
            return null; 
        } 
        Range r = docRange.createRange();
        // some xml parsers don't allow end<start in the same text node. So, 
        // handle dot<mark here 
 
        if (this.markInfo.range.compareBoundaryPoints(Range.START_TO_START, this.dotInfo.range) <= 0) {
            r.setStart(this.markInfo.range.getStartContainer(), this.markInfo.range
                    .getStartOffset());
            r.setEnd(this.dotInfo.range.getStartContainer(), this.dotInfo.range.getStartOffset());
        } else { 
            r.setStart(this.dotInfo.range.getStartContainer(), this.dotInfo.range.getStartOffset());
            r.setEnd(this.markInfo.range.getStartContainer(), this.markInfo.range.getStartOffset());
        } 
        return r;
    } 
 
4
CodeRank
See Code Examples for Java 8 DocumentRange Methods: