org.mozilla.jrex.selection
Interface JRexSelection

All Known Implementing Classes:
JRexSelectionImpl

public interface JRexSelection

JRexSelection interface defines selection related operations.

Version:
1.0
Author:
C.N.Medappa

Method Summary
 void addRange(Range range)
          Adds a range to the current selection.
 void collapse(Node parentNode, int offset)
          Collapses the selection to a single point, at the specified offset in the given DOM node.
 void collapseToEnd()
          Collapses the whole selection to a single point at the end of the current selection (irrespective of direction).
 void collapseToStart()
          Collapses the whole selection to a single point at the start of the current selection (irrespective of direction).
 boolean containsNode(Node node, boolean entirelyContained)
          The value of entirelyContained determines the detail of the search to determine if the selection contains the node.
 void deleteFromDocument()
          Deletes this selection from document the nodes belong to.
 void extend(Node parentNode, int offset)
          Extends the selection by moving the focus to the specified node and offset, preserving the anchor postion.
 Node getAnchorNode()
          Returns the node representing one end of the selection.
 int getAnchorOffset()
          Returns the offset within the (text) node where the selection begins.
 Node getFocusNode()
          Returns the node with keyboard focus.
 int getFocusOffset()
          Returns the offset within the (text) node where focus starts.
 boolean getIsCollapsed()
          Indicates if the selection is collapsed or not.
 Range getRangeAt(int index)
          Returns the range at given index.
 int getRangeCount()
          Returns the number of ranges in the selection.
 void removeAllRanges()
          Removes all ranges from the current selection.
 void removeRange(Range range)
          Removes a range from the current selection.
 void selectAllChildren(Node parentNode)
          Adds all children of the specified node to the selection.
 void selectionLanguageChange(boolean langRTL)
          Modifies the cursor Bidi level after a change in keyboard direction
 void setJRexPeer(int jrexPeer)
          The peer JREX Window on which to select
 String toString()
          Returns the whole selection into a plain text string.
 

Method Detail

setJRexPeer

public void setJRexPeer(int jrexPeer)
The peer JREX Window on which to select

Parameters:
jrexPeer - jrex peer window associated with browser component

getAnchorNode

public Node getAnchorNode()
                   throws JRexException
Returns the node representing one end of the selection.

JRexException

getAnchorOffset

public int getAnchorOffset()
                    throws JRexException
Returns the offset within the (text) node where the selection begins.

JRexException

getFocusNode

public Node getFocusNode()
                  throws JRexException
Returns the node with keyboard focus.

JRexException

getFocusOffset

public int getFocusOffset()
                   throws JRexException
Returns the offset within the (text) node where focus starts.

JRexException

getIsCollapsed

public boolean getIsCollapsed()
                       throws JRexException
Indicates if the selection is collapsed or not.

JRexException

getRangeCount

public int getRangeCount()
                  throws JRexException
Returns the number of ranges in the selection.

JRexException

getRangeAt

public Range getRangeAt(int index)
                 throws JRexException
Returns the range at given index.

Parameters:
index - the index of range to retrived.
JRexException

collapse

public void collapse(Node parentNode,
                     int offset)
              throws JRexException
Collapses the selection to a single point, at the specified offset in the given DOM node. When the selection is collapsed, and the content is focused and editable, the caret will blink there.

Parameters:
parentNode - The given dom node where the selection will be set
offset - Where in given dom node to place the selection (the offset into the given node)
JRexException

extend

public void extend(Node parentNode,
                   int offset)
            throws JRexException
Extends the selection by moving the focus to the specified node and offset, preserving the anchor postion. The new selection end result will always be from the anchor to the new focus, regardless of direction.

Parameters:
parentNode - The node where the selection will be extended to
offset - Where in node to place the offset in the new focused node
JRexException

collapseToStart

public void collapseToStart()
                     throws JRexException
Collapses the whole selection to a single point at the start of the current selection (irrespective of direction). If content is focused and editable, the caret will blink there.

JRexException

collapseToEnd

public void collapseToEnd()
                   throws JRexException
Collapses the whole selection to a single point at the end of the current selection (irrespective of direction). If content is focused and editable, the caret will blink there.

JRexException

containsNode

public boolean containsNode(Node node,
                            boolean entirelyContained)
                     throws JRexException
The value of entirelyContained determines the detail of the search to determine if the selection contains the node. If entirelyContained is set to PR_TRUE, t or false if

Parameters:
node - The node where the selection will be extended to
entirelyContained - Whether
JRexException

selectAllChildren

public void selectAllChildren(Node parentNode)
                       throws JRexException
Adds all children of the specified node to the selection.

Parameters:
parentNode - the parent of the children to be added to the selection.
JRexException

addRange

public void addRange(Range range)
              throws JRexException
Adds a range to the current selection.

Parameters:
range - the range to be added.
JRexException

removeRange

public void removeRange(Range range)
                 throws JRexException
Removes a range from the current selection.

Parameters:
range - the range to be removed.
JRexException

removeAllRanges

public void removeAllRanges()
                     throws JRexException
Removes all ranges from the current selection.

JRexException

deleteFromDocument

public void deleteFromDocument()
                        throws JRexException
Deletes this selection from document the nodes belong to.

JRexException

selectionLanguageChange

public void selectionLanguageChange(boolean langRTL)
                             throws JRexException
Modifies the cursor Bidi level after a change in keyboard direction

Parameters:
langRTL - is true if the new language is right-to-left or false if the new language is left-to-right.
JRexException

toString

public String toString()
Returns the whole selection into a plain text string.

Overrides:
toString in class Object


Copyright © 2004 C.N.Medappa. All Rights Reserved.