|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.Range
public class Range
Constructor Summary | |
---|---|
|
Range()
|
protected |
Range(java.lang.Class dummy)
|
|
Range(Document rootContainer)
|
|
Range(Node startContainer,
long startOffset,
Node endContainer,
long endOffset)
|
|
Range(Range other)
|
Method Summary | |
---|---|
boolean |
boundaryPointsValid()
not part of the DOM Compare the boundary-points of a range. |
DocumentFragment |
cloneContents()
Duplicates the contents of a range |
Range |
cloneRange()
Produces a new range whose end-points are equal to the end-points of the range. |
void |
collapse(boolean toStart)
Collapse a range onto one of its end-points |
boolean |
collapsed()
true if the range is collapsed |
Node |
commonAncestorContainer()
Gets the common ancestor container of the range's two end-points. |
DocumentFragment |
createContextualFragment(java.lang.String html)
|
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. |
Node |
endContainer()
Node within which the range ends |
long |
endOffset()
Offset within the ending node of the range. |
DocumentFragment |
extractContents()
Moves the contents of a range from the containing document or document fragment to a new DocumentFragment. |
void |
insertNode(Node newNode)
Inserts a node into the document or document fragment at the start of the range. |
boolean |
isDetached()
not part of the DOM true if the range is detached |
boolean |
isNull()
not part of the DOM |
void |
selectNode(Node refNode)
Select a node and its contents |
void |
selectNodeContents(Node refNode)
Select the contents within a node |
void |
setEnd(Node refNode,
long offset)
Sets the attributes describing the end of a range. |
void |
setEndAfter(Node refNode)
Sets the end of a range to be after a node |
void |
setEndBefore(Node refNode)
Sets the end position to be before a node. |
void |
setStart(Node refNode,
long offset)
Sets the attributes describing the start of the range. |
void |
setStartAfter(Node refNode)
Sets the start position to be after a node |
void |
setStartBefore(Node refNode)
Sets the start position to be before a node |
Node |
startContainer()
Node within which the range begins |
long |
startOffset()
Offset within the starting node of the range. |
void |
surroundContents(Node newParent)
Reparents 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 |
toHTML()
|
java.lang.String |
toString()
Returns the contents of a range as a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected Range(java.lang.Class dummy)
public Range()
public Range(Document rootContainer)
public Range(Range other)
public Range(Node startContainer, long startOffset, Node endContainer, long endOffset)
Method Detail |
---|
public Node startContainer()
public long startOffset()
public Node endContainer()
public long endOffset()
public boolean collapsed()
public Node commonAncestorContainer()
public void setStart(Node refNode, long offset)
refNode
- The refNode
value. This parameter
must be different from null
.offset
- The startOffset
value.
INVALID_NODE_TYPE_ERR: Raised if refNode
or an
ancestor of refNode
is an Attr, Entity,
Notation, or DocumentType node.
If an offset is out-of-bounds, should it just be fixed up or
should an exception be raised.public void setEnd(Node refNode, long offset)
refNode
- The refNode
value. This parameter
must be different from null
.offset
- The endOffset
value.
INVALID_NODE_TYPE_ERR: Raised if refNode
or an
ancestor of refNode
is an Attr, Entity,
Notation, or DocumentType node.public void setStartBefore(Node refNode)
refNode
- Range starts before refNode
public void setStartAfter(Node refNode)
refNode
- Range starts after refNode
public void setEndBefore(Node refNode)
refNode
- Range ends before refNode
public void setEndAfter(Node refNode)
refNode
- Range ends after refNode
.public void collapse(boolean toStart)
toStart
- If true, collapses the Range onto its start; if
false, collapses it onto its end.public void selectNode(Node refNode)
refNode
- The node to select.public void selectNodeContents(Node refNode)
refNode
- Node to select frompublic boolean boundaryPointsValid()
public void deleteContents()
public DocumentFragment extractContents()
public DocumentFragment cloneContents()
public void insertNode(Node newNode)
newNode
- The node to insert at the start of the range
WRONG_DOCUMENT_ERR: Raised if newNode
and the
container of the start of the Range were not created from the
same document.
HIERARCHY_REQUEST_ERR: Raised if the container of the start of
the Range is of a type that does not allow children of the type
of newNode
or if newNode
is an
ancestor of the container .public void surroundContents(Node newParent)
newParent
- The node to surround the contents with.
WRONG_DOCUMENT_ERR: Raised if newParent
and the
container of the start of the Range were not created from the
same document.
HIERARCHY_REQUEST_ERR: Raised if the container of the start of
the Range is of a type that does not allow children of the type
of newParent
or if newParent
is
an ancestor of the container or if node
would
end up with a child node of a type not allowed by the type of
node
.
INVALID_NODE_TYPE_ERR: Raised if node
is an
Attr, Entity, DocumentType, Notation, Document, or
DocumentFragment node.public Range cloneRange()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toHTML()
public DocumentFragment createContextualFragment(java.lang.String html)
public void detach()
public boolean isDetached()
public boolean isNull()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |