org.mozilla.webclient
Interface Selection


public interface Selection

Selection is more like a DOM Range object which represents a portion of a document or a document fragment. This is described as all of the content between two boundary points, the start and end containers. A selection is define by the following properties: startContainer, endContainer, startOffset, endOffset and the text representation of the selection.

Author:
daepark@apmindsf.com

Method Summary
 org.w3c.dom.Node getEndContainer()
          Get the Node that contains the end of this selection.
 int getEndOffset()
          Get the offset to which the selection ends within the endContainer.
 org.w3c.dom.Node getStartContainer()
          Get the Node that contains the start of this selection.
 int getStartOffset()
          Get the offset to which the selection starts within the startContainer.
 void init(java.lang.String selection, org.w3c.dom.Node startContainer, org.w3c.dom.Node endContainer, int startOffset, int endOffset)
          Initialize this Selection object.
 boolean isValid()
          Test if the selection properties have been set.
 java.lang.String toString()
          Get the text representation of this Selection object.
 

Method Detail

init

void init(java.lang.String selection,
          org.w3c.dom.Node startContainer,
          org.w3c.dom.Node endContainer,
          int startOffset,
          int endOffset)
Initialize this Selection object.

Parameters:
selection - the text representation of this selection
startContainer - the start of this selection is contained within this node
endContainer - the end of this selection is contained within this node
startOffset - the offset to which the selection starts within the startContainer
endOffset - the offset to which the selection ends within the endContainer
See Also:
isValid()

toString

java.lang.String toString()
Get the text representation of this Selection object.

Overrides:
toString in class java.lang.Object

getStartContainer

org.w3c.dom.Node getStartContainer()
Get the Node that contains the start of this selection.


getEndContainer

org.w3c.dom.Node getEndContainer()
Get the Node that contains the end of this selection.


getStartOffset

int getStartOffset()
Get the offset to which the selection starts within the startContainer.


getEndOffset

int getEndOffset()
Get the offset to which the selection ends within the endContainer.


isValid

boolean isValid()
Test if the selection properties have been set.



Copyright 2002-2007 Mozilla.org All Rights Reserved.