|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.core.client.JavaScriptObject
org.xwiki.gwt.dom.client.JavaScriptObject
org.xwiki.gwt.dom.client.internal.mozilla.NativeRange
public final class NativeRange
The native range implementation for browsers that follow the W3C Range specification.
| Constructor Summary | |
|---|---|
protected |
NativeRange()
Default constructor. |
| Method Summary | |
|---|---|
DocumentFragment |
cloneContents()
Duplicates the contents of this range. |
NativeRange |
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(int how,
NativeRange 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()
|
static NativeRange |
newInstance(Document document)
Creates a new native range using the given document. |
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. |
| Methods inherited from class org.xwiki.gwt.dom.client.JavaScriptObject |
|---|
fromJson, get, getKeys, remove, set |
| Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
|---|
cast, createArray, createFunction, createObject, equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected NativeRange()
| Method Detail |
|---|
public static NativeRange newInstance(Document document)
document - the document to use for creating the new native range
public boolean isCollapsed()
public com.google.gwt.dom.client.Node getCommonAncestorContainer()
public com.google.gwt.dom.client.Node getEndContainer()
public int getEndOffset()
public com.google.gwt.dom.client.Node getStartContainer()
public int getStartOffset()
public void setStart(com.google.gwt.dom.client.Node refNode,
int offset)
refNode - the #startContainer value. This parameter must be different from null.offset - the #startOffset value
public void setEnd(com.google.gwt.dom.client.Node refNode,
int offset)
refNode - the #endContainer value. This parameter must be different from null.offset - the #endOffset valuepublic void setStartBefore(com.google.gwt.dom.client.Node refNode)
refNode - the reference node, before which this range will startpublic void setStartAfter(com.google.gwt.dom.client.Node refNode)
refNode - the reference node, after which this range will startpublic void setEndBefore(com.google.gwt.dom.client.Node refNode)
refNode - the reference node, before which this range will endpublic void setEndAfter(com.google.gwt.dom.client.Node refNode)
refNode - the reference node, after which this range will endpublic void selectNode(com.google.gwt.dom.client.Node refNode)
refNode - the node to selectpublic void selectNodeContents(com.google.gwt.dom.client.Node refNode)
refNode - the node to select frompublic void collapse(boolean toStart)
toStart - if true, collapses this range onto its start; if false, collapses it onto its end.public DocumentFragment cloneContents()
public void deleteContents()
public DocumentFragment extractContents()
public void insertNode(com.google.gwt.dom.client.Node newNode)
newNode - the node to insert at the start of this range.public void surroundContents(com.google.gwt.dom.client.Node newParent)
newParent - the node to surround the contents with
public short compareBoundaryPoints(int how,
NativeRange sourceRange)
how - the type of comparisonsourceRange - the range to compared to
public NativeRange cloneRange()
public void detach()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||