com.webrenderer.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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

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


surroundContents

public 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

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


getStartContainer

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


getEndContainer

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


getStartOffset

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


getEndOffset

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


getCommonAncestorContainer

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