public interface Range
Document or DocumentFragment that can contain nodes and parts of text
nodes.| Modifier and Type | Method and Description |
|---|---|
DocumentFragment |
cloneContents()
Duplicates the contents of this range.
|
Range |
cloneRange()
Produces a new Range whose boundary-points are equal to the boundary-points of this range.
|
void |
collapse(boolean toStart)
Collapse this range onto one of its boundary-points.
|
short |
compareBoundaryPoints(RangeCompare how,
Range sourceRange)
Compare the boundary-points of two Ranges in a document.
|
void |
deleteContents()
Removes the contents of this range from the containing document or document fragment without returning a
reference to the removed content.
|
void |
detach()
Called to indicate that this range is no longer in use and that the implementation may relinquish any resources
associated with this range.
|
DocumentFragment |
extractContents()
Moves the contents of this range from the containing document or document fragment to a new DocumentFragment.
|
com.google.gwt.dom.client.Node |
getCommonAncestorContainer() |
com.google.gwt.dom.client.Node |
getEndContainer() |
int |
getEndOffset() |
com.google.gwt.dom.client.Node |
getStartContainer() |
int |
getStartOffset() |
void |
insertNode(com.google.gwt.dom.client.Node newNode)
Inserts a node into the Document or DocumentFragment at the start of the Range.
|
boolean |
isCollapsed() |
void |
selectNode(com.google.gwt.dom.client.Node refNode)
Select a node and its contents.
|
void |
selectNodeContents(com.google.gwt.dom.client.Node refNode)
Select the contents within a node.
|
void |
setEnd(com.google.gwt.dom.client.Node refNode,
int offset)
Sets the attributes describing the end of this range.
|
void |
setEndAfter(com.google.gwt.dom.client.Node refNode)
Sets the end of this Range to be after the given node.
|
void |
setEndBefore(com.google.gwt.dom.client.Node refNode)
Sets the end position to be before the given node.
|
void |
setStart(com.google.gwt.dom.client.Node refNode,
int offset)
Sets the attributes describing the start of this range.
|
void |
setStartAfter(com.google.gwt.dom.client.Node refNode)
Sets the start position to be after the given node.
|
void |
setStartBefore(com.google.gwt.dom.client.Node refNode)
Sets the start position to be before the given node.
|
void |
surroundContents(com.google.gwt.dom.client.Node newParent)
Re-parents the contents of this range to the given node and inserts the node at the position of the start of this
range.
|
String |
toHTML() |
String |
toString()
Returns the contents of this range as a string.
|
DocumentFragment cloneContents()
Range cloneRange()
void collapse(boolean toStart)
toStart - if true, collapses this range onto its start; if false, collapses it onto its end.short compareBoundaryPoints(RangeCompare how, Range sourceRange)
how - the type of comparisonsourceRange - the range to compared tovoid deleteContents()
void detach()
DocumentFragment extractContents()
com.google.gwt.dom.client.Node getCommonAncestorContainer()
com.google.gwt.dom.client.Node getEndContainer()
int getEndOffset()
com.google.gwt.dom.client.Node getStartContainer()
int getStartOffset()
void insertNode(com.google.gwt.dom.client.Node newNode)
newNode - the node to insert at the start of this range.boolean isCollapsed()
void selectNode(com.google.gwt.dom.client.Node refNode)
refNode - the node to selectvoid selectNodeContents(com.google.gwt.dom.client.Node refNode)
refNode - the node to select fromvoid setEnd(com.google.gwt.dom.client.Node refNode,
int offset)
refNode - the #endContainer value. This parameter must be different from null.offset - the #endOffset valuevoid setEndAfter(com.google.gwt.dom.client.Node refNode)
refNode - the reference node, after which this range will endvoid setEndBefore(com.google.gwt.dom.client.Node refNode)
refNode - the reference node, before which this range will endvoid setStart(com.google.gwt.dom.client.Node refNode,
int offset)
refNode - the #startContainer value. This parameter must be different from null.offset - the #startOffset valuevoid setStartAfter(com.google.gwt.dom.client.Node refNode)
refNode - the reference node, after which this range will startvoid setStartBefore(com.google.gwt.dom.client.Node refNode)
refNode - the reference node, before which this range will startvoid surroundContents(com.google.gwt.dom.client.Node newParent)
newParent - the node to surround the contents withString toHTML()
Copyright © 2004–2014 XWiki. All rights reserved.