|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.gwt.dom.client.internal.DefaultRange
public class DefaultRange
This is a cross-browser implementation of the W3C Range specification.
Acknowledgment to Mozilla Foundation for making nsRange.cpp public.
http://hg.mozilla.org/mozilla-central/file/b945b4f67e7e/content/base/src/nsRange.cpp| Constructor Summary | |
|---|---|
DefaultRange()
|
|
| Method Summary | |
|---|---|
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. |
java.lang.String |
toHTML()
|
java.lang.String |
toString()
Returns the contents of this range as a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultRange()
| Method Detail |
|---|
public DocumentFragment cloneContents()
cloneContents in interface RangeRange.cloneContents()public Range cloneRange()
cloneRange in interface RangeRange.cloneRange()public void collapse(boolean toStart)
collapse in interface RangetoStart - if true, collapses this range onto its start; if false, collapses it onto its end.Range.collapse(boolean)
public short compareBoundaryPoints(RangeCompare how,
Range sourceRange)
compareBoundaryPoints in interface Rangehow - the type of comparisonsourceRange - the range to compared to
Range.compareBoundaryPoints(RangeCompare, Range)public void deleteContents()
deleteContents in interface RangeRange.deleteContents()public void detach()
detach in interface RangeRange.detach()public DocumentFragment extractContents()
extractContents in interface RangeRange.extractContents(),
deleteContents()public com.google.gwt.dom.client.Node getCommonAncestorContainer()
getCommonAncestorContainer in interface RangeRange.getCommonAncestorContainer()public com.google.gwt.dom.client.Node getEndContainer()
getEndContainer in interface RangeRange.getEndContainer()public int getEndOffset()
getEndOffset in interface RangeRange.getEndOffset()public com.google.gwt.dom.client.Node getStartContainer()
getStartContainer in interface RangeRange.getStartContainer()public int getStartOffset()
getStartOffset in interface RangeRange.getStartOffset()public void insertNode(com.google.gwt.dom.client.Node newNode)
insertNode in interface RangenewNode - the node to insert at the start of this range.Range.insertNode(Node)public boolean isCollapsed()
isCollapsed in interface RangeRange.isCollapsed()public void selectNode(com.google.gwt.dom.client.Node refNode)
selectNode in interface RangerefNode - the node to selectRange.selectNode(Node)public void selectNodeContents(com.google.gwt.dom.client.Node refNode)
selectNodeContents in interface RangerefNode - the node to select fromRange.selectNodeContents(Node)
public void setEnd(com.google.gwt.dom.client.Node refNode,
int offset)
setEnd in interface RangerefNode - the #endContainer value. This parameter must be different from null.offset - the #endOffset valueRange.setEnd(Node, int)public void setEndAfter(com.google.gwt.dom.client.Node refNode)
setEndAfter in interface RangerefNode - the reference node, after which this range will endRange.setEndAfter(Node)public void setEndBefore(com.google.gwt.dom.client.Node refNode)
setEndBefore in interface RangerefNode - the reference node, before which this range will endRange.setEndBefore(Node)
public void setStart(com.google.gwt.dom.client.Node refNode,
int offset)
setStart in interface RangerefNode - the #startContainer value. This parameter must be different from null.offset - the #startOffset valueRange.setStart(Node, int)public void setStartAfter(com.google.gwt.dom.client.Node refNode)
setStartAfter in interface RangerefNode - the reference node, after which this range will startRange.setStartAfter(Node)public void setStartBefore(com.google.gwt.dom.client.Node refNode)
setStartBefore in interface RangerefNode - the reference node, before which this range will startRange.setStartBefore(Node)public void surroundContents(com.google.gwt.dom.client.Node newParent)
surroundContents in interface RangenewParent - the node to surround the contents withRange.surroundContents(Node)public java.lang.String toHTML()
toHTML in interface RangeRange.toHTML()public java.lang.String toString()
toString in interface RangetoString in class java.lang.ObjectRange.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||