当前位置: 首页>>代码示例>>Java>>正文


Java RangeException.INVALID_NODE_TYPE_ERR属性代码示例

本文整理汇总了Java中org.w3c.dom.ranges.RangeException.INVALID_NODE_TYPE_ERR属性的典型用法代码示例。如果您正苦于以下问题:Java RangeException.INVALID_NODE_TYPE_ERR属性的具体用法?Java RangeException.INVALID_NODE_TYPE_ERR怎么用?Java RangeException.INVALID_NODE_TYPE_ERR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.w3c.dom.ranges.RangeException的用法示例。


在下文中一共展示了RangeException.INVALID_NODE_TYPE_ERR属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setStart

public void setStart(Node refNode, int offset)
                     throws RangeException, DOMException
{
    if (fDocument.errorChecking) {
        if ( fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !isLegalContainer(refNode)) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }

    checkIndex(refNode, offset);

    fStartContainer = refNode;
    fStartOffset = offset;

    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(true);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:RangeImpl.java

示例2: setEnd

public void setEnd(Node refNode, int offset)
                   throws RangeException, DOMException
{
    if (fDocument.errorChecking) {
        if (fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !isLegalContainer(refNode)) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }

    checkIndex(refNode, offset);

    fEndContainer = refNode;
    fEndOffset = offset;

    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(false);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:RangeImpl.java

示例3: setStartBefore

public void setStartBefore(Node refNode)
    throws RangeException
{
    if (fDocument.errorChecking) {
        if (fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !hasLegalRootContainer(refNode) ||
                !isLegalContainedNode(refNode) )
        {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }

    fStartContainer = refNode.getParentNode();
    int i = 0;
    for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
        i++;
    }
    fStartOffset = i-1;

    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(true);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:RangeImpl.java

示例4: setStartAfter

public void setStartAfter(Node refNode)
    throws RangeException
{
    if (fDocument.errorChecking) {
        if (fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !hasLegalRootContainer(refNode) ||
                !isLegalContainedNode(refNode)) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
    fStartContainer = refNode.getParentNode();
    int i = 0;
    for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
        i++;
    }
    fStartOffset = i;

    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(true);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:RangeImpl.java

示例5: setEndBefore

public void setEndBefore(Node refNode)
    throws RangeException
{
    if (fDocument.errorChecking) {
        if (fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !hasLegalRootContainer(refNode) ||
                !isLegalContainedNode(refNode)) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
    fEndContainer = refNode.getParentNode();
    int i = 0;
    for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
        i++;
    }
    fEndOffset = i-1;

    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(false);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:RangeImpl.java

示例6: setEndAfter

public void setEndAfter(Node refNode)
    throws RangeException
{
    if (fDocument.errorChecking) {
        if( fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !hasLegalRootContainer(refNode) ||
                !isLegalContainedNode(refNode)) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
    fEndContainer = refNode.getParentNode();
    int i = 0;
    for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
        i++;
    }
    fEndOffset = i;

    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(false);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:RangeImpl.java

示例7: selectNode

public void selectNode(Node refNode)
    throws RangeException
{
    if (fDocument.errorChecking) {
        if (fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !isLegalContainer( refNode.getParentNode() ) ||
                !isLegalContainedNode( refNode ) ) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
    Node parent = refNode.getParentNode();
    if (parent != null ) // REVIST: what to do if it IS null?
    {
        fStartContainer = parent;
        fEndContainer = parent;
        int i = 0;
        for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
            i++;
        }
        fStartOffset = i-1;
        fEndOffset = fStartOffset+1;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:RangeImpl.java

示例8: selectNodeContents

public void selectNodeContents(Node refNode)
    throws RangeException
{
    if (fDocument.errorChecking) {
        if( fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !isLegalContainer(refNode)) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
    fStartContainer = refNode;
    fEndContainer = refNode;
    Node first = refNode.getFirstChild();
    fStartOffset = 0;
    if (first == null) {
        fEndOffset = 0;
    } else {
        int i = 0;
        for (Node n = first; n!=null; n = n.getNextSibling()) {
            i++;
        }
        fEndOffset = i;
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:RangeImpl.java

示例9: setStart

public void setStart(Node refNode, int offset)
                     throws RangeException, DOMException
{
    if (fDocument.errorChecking) {
        if ( fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !isLegalContainer(refNode)) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
    
    checkIndex(refNode, offset);
    
    fStartContainer = refNode;
    fStartOffset = offset;
    
    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(true);
    } 
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:36,代码来源:RangeImpl.java

示例10: setEnd

public void setEnd(Node refNode, int offset)
                   throws RangeException, DOMException
{
    if (fDocument.errorChecking) {
        if (fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !isLegalContainer(refNode)) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
	
    checkIndex(refNode, offset);
    
    fEndContainer = refNode;
    fEndOffset = offset;
    
    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(false);
    } 
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:36,代码来源:RangeImpl.java

示例11: setStartBefore

public void setStartBefore(Node refNode) 
    throws RangeException 
{
    if (fDocument.errorChecking) {
        if (fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !hasLegalRootContainer(refNode) ||
                !isLegalContainedNode(refNode) )
        {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
	
    fStartContainer = refNode.getParentNode();
    int i = 0;
    for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
        i++;
    }
    fStartOffset = i-1;
    
    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(true);
    }  
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:40,代码来源:RangeImpl.java

示例12: setStartAfter

public void setStartAfter(Node refNode)
    throws RangeException
{
    if (fDocument.errorChecking) {
        if (fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !hasLegalRootContainer(refNode) || 
                !isLegalContainedNode(refNode)) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
    fStartContainer = refNode.getParentNode();
    int i = 0;
    for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
        i++;
    }
    fStartOffset = i;
    
    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(true);
    } 
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:38,代码来源:RangeImpl.java

示例13: setEndBefore

public void setEndBefore(Node refNode)
    throws RangeException
{
    if (fDocument.errorChecking) {
        if (fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !hasLegalRootContainer(refNode) ||
                !isLegalContainedNode(refNode)) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
    fEndContainer = refNode.getParentNode();
    int i = 0;
    for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
        i++;
    }
    fEndOffset = i-1;

    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(false);
    } 
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:38,代码来源:RangeImpl.java

示例14: setEndAfter

public void setEndAfter(Node refNode)
    throws RangeException
{
    if (fDocument.errorChecking) {
        if( fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !hasLegalRootContainer(refNode) ||
                !isLegalContainedNode(refNode)) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
    fEndContainer = refNode.getParentNode();
    int i = 0;
    for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
        i++;
    }
    fEndOffset = i;
    
    // If one boundary-point of a Range is set to have a root container
    // other
    // than the current one for the Range, the Range should be collapsed to
    // the new position.
    // The start position of a Range should never be after the end position.
    if (getCommonAncestorContainer() == null
            || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
        collapse(false);
    } 
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:38,代码来源:RangeImpl.java

示例15: selectNode

public void selectNode(Node refNode)
    throws RangeException
{
    if (fDocument.errorChecking) {
        if (fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if ( !isLegalContainer( refNode.getParentNode() ) ||
                !isLegalContainedNode( refNode ) ) {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
        if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
            throw new DOMException(
                    DOMException.WRONG_DOCUMENT_ERR,
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
        }
    }
    Node parent = refNode.getParentNode();
    if (parent != null ) // REVIST: what to do if it IS null?
    {
        fStartContainer = parent;
        fEndContainer = parent;
        int i = 0;
        for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
            i++;
        }
        fStartOffset = i-1;
        fEndOffset = fStartOffset+1;
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:34,代码来源:RangeImpl.java


注:本文中的org.w3c.dom.ranges.RangeException.INVALID_NODE_TYPE_ERR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。