Java Code Examples for org.w3c.dom.ranges.Range#setEnd()

The following examples show how to use org.w3c.dom.ranges.Range#setEnd() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RangeImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public Range cloneRange(){
    if( fDetach) {
            throw new DOMException(
            DOMException.INVALID_STATE_ERR,
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
    }

    Range range = fDocument.createRange();
    range.setStart(fStartContainer, fStartOffset);
    range.setEnd(fEndContainer, fEndOffset);
    return range;
}
 
Example 2
Source File: RangeImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Range cloneRange(){
    if( fDetach) {
            throw new DOMException(
            DOMException.INVALID_STATE_ERR,
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
    }

    Range range = fDocument.createRange();
    range.setStart(fStartContainer, fStartOffset);
    range.setEnd(fEndContainer, fEndOffset);
    return range;
}
 
Example 3
Source File: RangeImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Range cloneRange(){
    if( fDetach) {
            throw new DOMException(
            DOMException.INVALID_STATE_ERR,
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
    }

    Range range = fDocument.createRange();
    range.setStart(fStartContainer, fStartOffset);
    range.setEnd(fEndContainer, fEndOffset);
    return range;
}
 
Example 4
Source File: RangeImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public Range cloneRange(){
    if( fDetach) {
            throw new DOMException(
            DOMException.INVALID_STATE_ERR,
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
    }

    Range range = fDocument.createRange();
    range.setStart(fStartContainer, fStartOffset);
    range.setEnd(fEndContainer, fEndOffset);
    return range;
}
 
Example 5
Source File: Selection.java    From htmlunit with Apache License 2.0 5 votes vote down vote up
/**
 * Moves the focus of the selection to a specified point. The anchor of the selection does not move.
 * @param parentNode the node within which the focus will be moved
 * @param offset the number of characters from the beginning of parentNode's text the focus will be placed
 */
@JsxFunction({CHROME, FF, FF68, FF60})
public void extend(final Node parentNode, final int offset) {
    final Range last = getLastRange();
    if (last != null) {
        last.setEnd(parentNode.getDomNodeOrDie(), offset);

        type_ = TYPE_RANGE;
    }
}
 
Example 6
Source File: Selection.java    From HtmlUnit-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Moves the focus of the selection to a specified point. The anchor of the selection does not move.
 * @param parentNode the node within which the focus will be moved
 * @param offset the number of characters from the beginning of parentNode's text the focus will be placed
 */
@JsxFunction({CHROME, FF})
public void extend(final Node parentNode, final int offset) {
    final Range last = getLastRange();
    if (last != null) {
        last.setEnd(parentNode.getDomNodeOrDie(), offset);

        type_ = TYPE_RANGE;
    }
}
 
Example 7
Source File: RangeImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Range cloneRange(){
    if( fDetach) {
            throw new DOMException(
            DOMException.INVALID_STATE_ERR,
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
    }

    Range range = fDocument.createRange();
    range.setStart(fStartContainer, fStartOffset);
    range.setEnd(fEndContainer, fEndOffset);
    return range;
}
 
Example 8
Source File: RangeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Range cloneRange(){
    if( fDetach) {
            throw new DOMException(
            DOMException.INVALID_STATE_ERR,
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
    }

    Range range = fDocument.createRange();
    range.setStart(fStartContainer, fStartOffset);
    range.setEnd(fEndContainer, fEndOffset);
    return range;
}
 
Example 9
Source File: RangeImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public Range cloneRange(){
    if( fDetach) {
            throw new DOMException(
            DOMException.INVALID_STATE_ERR,
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
    }

    Range range = fDocument.createRange();
    range.setStart(fStartContainer, fStartOffset);
    range.setEnd(fEndContainer, fEndOffset);
    return range;
}
 
Example 10
Source File: RangeImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Range cloneRange(){
    if( fDetach) {
            throw new DOMException(
            DOMException.INVALID_STATE_ERR,
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
    }

    Range range = fDocument.createRange();
    range.setStart(fStartContainer, fStartOffset);
    range.setEnd(fEndContainer, fEndOffset);
    return range;
}
 
Example 11
Source File: RangeImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Range cloneRange(){
    if( fDetach) {
            throw new DOMException(
            DOMException.INVALID_STATE_ERR,
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
    }

    Range range = fDocument.createRange();
    range.setStart(fStartContainer, fStartOffset);
    range.setEnd(fEndContainer, fEndOffset);
    return range;
}
 
Example 12
Source File: RangeImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Range cloneRange(){
    if( fDetach) {
            throw new DOMException(
            DOMException.INVALID_STATE_ERR,
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
    }

    Range range = fDocument.createRange();
    range.setStart(fStartContainer, fStartOffset);
    range.setEnd(fEndContainer, fEndOffset);
    return range;
}
 
Example 13
Source File: RangeImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Range cloneRange(){
    if( fDetach) {
            throw new DOMException(
            DOMException.INVALID_STATE_ERR,
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
    }

    Range range = fDocument.createRange();
    range.setStart(fStartContainer, fStartOffset);
    range.setEnd(fEndContainer, fEndOffset);
    return range;
}