com.webrenderer.se.dom
Interface IRange


public interface IRange

Stores a Range Object (Mozilla Only)
A range can cross a group of Elements and can start or stop half way through an Element


Method Summary
 void collapse(boolean toStart)
          Sets the start and end Elements and offsets the the same value.
 void deleteContents()
          Removes the contents of the range from the docuement.
 IElement getCommonAncestorContainer()
          Returns the Element that is a common parent to both start and end contianer elements
 IElement getEndContainer()
          Returns the ending Element of the range.
 int getEndOffset()
          Returns the offset into the ending Element that the range finishes.
 IElement getStartContainer()
          Returns the starting Element of the range.
 int getStartOffset()
          Returns the offset into the starting Element that the range starts.
 void setEnd(IElement node, int offset)
          Sets the end of the Range object to offset places through the given Element
Currently doesn't function correctly
 void setEndAfter(IElement node)
          Sets the end of the Range object to the end of given Element
 void setEndBefore(IElement node)
          Sets the end of the Range object to the start of given Element
 void setStart(IElement node, int offset)
          Sets the start of the Range object to offset places through the given Element
Currently doesn't function correctly
 void setStartAfter(IElement node)
          Sets the start of the Range object to the end of given Element
 void setStartBefore(IElement node)
          Sets the start of the Range object to the front of given Element
 void surroundContents(IElement e)
          Surrounds the Range with given Element.
 java.lang.String toString()
          Returns the text contents of the range without HTML Markup.
 

Method Detail

setStart

void setStart(IElement node,
              int offset)
Sets the start of the Range object to offset places through the given Element
Currently doesn't function correctly

Parameters:
node - Element to start range from
offset - places through element to start from

setStartBefore

void setStartBefore(IElement node)
Sets the start of the Range object to the front of given Element

Parameters:
node - Element to start range from

setStartAfter

void setStartAfter(IElement node)
Sets the start of the Range object to the end of given Element

Parameters:
node - Element to start range from

setEnd

void setEnd(IElement node,
            int offset)
Sets the end of the Range object to offset places through the given Element
Currently doesn't function correctly

Parameters:
node - Element to end range at
offset - places through element to end at

setEndBefore

void setEndBefore(IElement node)
Sets the end of the Range object to the start of given Element

Parameters:
node - Element to end range at

setEndAfter

void setEndAfter(IElement node)
Sets the end of the Range object to the end of given Element

Parameters:
node - Element to end range at

collapse

void collapse(boolean toStart)
Sets the start and end Elements and offsets the the same value.

Parameters:
toStart - If true use the first Element. If false use the end Element

deleteContents

void deleteContents()
Removes the contents of the range from the docuement.


surroundContents

void surroundContents(IElement e)
Surrounds the Range with given Element. The Element must be associated with the document.
ie: created with Document.createElement()

Parameters:
e - Element to surround range with.
See Also:
IDocument.createElement(String)

toString

java.lang.String toString()
Returns the text contents of the range without HTML Markup.

Overrides:
toString in class java.lang.Object

getStartContainer

IElement getStartContainer()
Returns the starting Element of the range.


getEndContainer

IElement getEndContainer()
Returns the ending Element of the range.


getStartOffset

int getStartOffset()
Returns the offset into the starting Element that the range starts.


getEndOffset

int getEndOffset()
Returns the offset into the ending Element that the range finishes.


getCommonAncestorContainer

IElement getCommonAncestorContainer()
Returns the Element that is a common parent to both start and end contianer elements