|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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.
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. |
String |
toHTML()
|
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()
Range
cloneContents
in interface Range
public Range cloneRange()
Range
cloneRange
in interface Range
public void collapse(boolean toStart)
Range
collapse
in interface Range
toStart
- if true, collapses this range onto its start; if false, collapses it onto its end.public short compareBoundaryPoints(RangeCompare how, Range sourceRange)
Range
compareBoundaryPoints
in interface Range
how
- the type of comparisonsourceRange
- the range to compared to
public void deleteContents()
Range
deleteContents
in interface Range
public void detach()
Range
detach
in interface Range
public DocumentFragment extractContents()
Range
extractContents
in interface Range
public com.google.gwt.dom.client.Node getCommonAncestorContainer()
getCommonAncestorContainer
in interface Range
public com.google.gwt.dom.client.Node getEndContainer()
getEndContainer
in interface Range
public int getEndOffset()
getEndOffset
in interface Range
public com.google.gwt.dom.client.Node getStartContainer()
getStartContainer
in interface Range
public int getStartOffset()
getStartOffset
in interface Range
public void insertNode(com.google.gwt.dom.client.Node newNode)
Range
insertNode
in interface Range
newNode
- the node to insert at the start of this range.public boolean isCollapsed()
isCollapsed
in interface Range
public void selectNode(com.google.gwt.dom.client.Node refNode)
Range
selectNode
in interface Range
refNode
- the node to selectpublic void selectNodeContents(com.google.gwt.dom.client.Node refNode)
Range
selectNodeContents
in interface Range
refNode
- the node to select frompublic void setEnd(com.google.gwt.dom.client.Node refNode, int offset)
Range
setEnd
in interface Range
refNode
- the #endContainer
value. This parameter must be different from null.offset
- the #endOffset
valuepublic void setEndAfter(com.google.gwt.dom.client.Node refNode)
Range
setEndAfter
in interface Range
refNode
- the reference node, after which this range will endpublic void setEndBefore(com.google.gwt.dom.client.Node refNode)
Range
setEndBefore
in interface Range
refNode
- the reference node, before which this range will endpublic void setStart(com.google.gwt.dom.client.Node refNode, int offset)
Range
setStart
in interface Range
refNode
- the #startContainer
value. This parameter must be different from null.offset
- the #startOffset
valuepublic void setStartAfter(com.google.gwt.dom.client.Node refNode)
Range
setStartAfter
in interface Range
refNode
- the reference node, after which this range will startpublic void setStartBefore(com.google.gwt.dom.client.Node refNode)
Range
setStartBefore
in interface Range
refNode
- the reference node, before which this range will startpublic void surroundContents(com.google.gwt.dom.client.Node newParent)
Range
surroundContents
in interface Range
newParent
- the node to surround the contents withpublic String toHTML()
toHTML
in interface Range
public String toString()
Range
toString
in interface Range
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |