|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Range
The Range object represents a fragment of a document that can contain nodes and parts of text nodes in a
given document.
| Method Summary | |
|---|---|
DocumentFragment |
cloneContents()
Duplicates the contents of a Range. |
Range |
cloneRange()
Produces a new Range whose boundary-points are equal to the boundary-points of the Range. |
void |
collapse(boolean toStart)
Collapse a 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 a Range from the containing document or document fragment without returning a reference to the removed content. |
void |
detach()
Called to indicate that the Range is no longer in use and that the implementation may relinquish any resources associated with this Range. |
DocumentFragment |
extractContents()
Moves the contents of a 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 a Range. |
void |
setEndAfter(com.google.gwt.dom.client.Node refNode)
Sets the end of a Range to be after a node. |
void |
setEndBefore(com.google.gwt.dom.client.Node refNode)
Sets the end position to be before a node. |
void |
setStart(com.google.gwt.dom.client.Node refNode,
int offset)
Sets the attributes describing the start of the Range. |
void |
setStartAfter(com.google.gwt.dom.client.Node refNode)
Sets the start position to be after a node. |
void |
setStartBefore(com.google.gwt.dom.client.Node refNode)
Sets the start position to be before a node. |
void |
surroundContents(com.google.gwt.dom.client.Node newParent)
Re-parents the contents of the Range to the given node and inserts the node at the position of the start of the Range. |
java.lang.String |
toString()
Returns the contents of a Range as a string. |
| Method Detail |
|---|
com.google.gwt.dom.client.Node getStartContainer()
int getStartOffset()
com.google.gwt.dom.client.Node getEndContainer()
int getEndOffset()
boolean isCollapsed()
com.google.gwt.dom.client.Node getCommonAncestorContainer()
void setStart(com.google.gwt.dom.client.Node refNode,
int offset)
refNode - The refNode value. This parameter must be different from null.offset - The startOffset value.
void setEnd(com.google.gwt.dom.client.Node refNode,
int offset)
refNode - The refNode value. This parameter must be different from null.offset - The endOffset value.void setStartBefore(com.google.gwt.dom.client.Node refNode)
refNode - Range starts before refNode.void setStartAfter(com.google.gwt.dom.client.Node refNode)
refNode - Range starts after refNode.void setEndBefore(com.google.gwt.dom.client.Node refNode)
refNode - Range ends before refNode.void setEndAfter(com.google.gwt.dom.client.Node refNode)
refNode - Range ends after refNode.void collapse(boolean toStart)
toStart - If true, collapses the Range onto its start; if false, collapses it onto its end.void selectNode(com.google.gwt.dom.client.Node refNode)
refNode - The node to select.void selectNodeContents(com.google.gwt.dom.client.Node refNode)
refNode - Node to select from.
short compareBoundaryPoints(RangeCompare how,
Range sourceRange)
how - The type of comparison.sourceRange - The Range on which this current Range is compared to.
void deleteContents()
DocumentFragment extractContents()
DocumentFragment cloneContents()
void insertNode(com.google.gwt.dom.client.Node newNode)
newNode - The node to insert at the start of the Range.void surroundContents(com.google.gwt.dom.client.Node newParent)
newParent - The node to surround the contents with.Range cloneRange()
java.lang.String toString()
toString in class java.lang.Objectvoid detach()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||