com.xpn.xwiki.wysiwyg.client.selection.internal
Class IERange

java.lang.Object
  extended by com.xpn.xwiki.wysiwyg.client.selection.internal.AbstractRange
      extended by com.xpn.xwiki.wysiwyg.client.selection.internal.IERange
All Implemented Interfaces:
Range

public class IERange
extends AbstractRange


Method Summary
 DocumentFragment cloneContents()
          Duplicates the contents of a Range.
 Range cloneRange()
          Produces a new Range whose boundary-points are equal to the boundary-points of the Range.
 void collapse(boolean toStart)
          Collapse a Range onto one of its boundary-points.
protected  short compareBoundaryPoints(int how, com.google.gwt.core.client.JavaScriptObject sourceRange)
           
 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.
 DocumentFragment extractContents()
          Moves the contents of a Range from the containing document or document fragment to a new DocumentFragment.
 com.google.gwt.dom.client.Node getCommonAncestorContainer()
           
 com.google.gwt.dom.client.Node getEndContainer()
           
 int getEndOffset()
           
 com.google.gwt.dom.client.Node getStartContainer()
           
 int getStartOffset()
           
 void insertNode(com.google.gwt.dom.client.Node newNode)
          Inserts a node into the Document or DocumentFragment at the start of the Range.
 boolean isCollapsed()
           
 void selectNode(com.google.gwt.dom.client.Node refNode)
          Select a node and its contents.
 void selectNodeContents(com.google.gwt.dom.client.Node refNode)
          Select the contents within a node.
 void setEnd(com.google.gwt.dom.client.Node refNode, int offset)
          Sets the attributes describing the end of a Range.
 void setEndAfter(com.google.gwt.dom.client.Node refNode)
          Sets the end of a Range to be after a node.
 void setEndBefore(com.google.gwt.dom.client.Node refNode)
          Sets the end position to be before a node.
 void setStart(com.google.gwt.dom.client.Node refNode, int offset)
          Sets the attributes describing the start of the Range.
 void setStartAfter(com.google.gwt.dom.client.Node refNode)
          Sets the start position to be after a node.
 void setStartBefore(com.google.gwt.dom.client.Node refNode)
          Sets the start position to be before a node.
 void surroundContents(com.google.gwt.dom.client.Node newParent)
          Re-parents 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 toString()
          Returns the contents of a Range as a string.
 
Methods inherited from class com.xpn.xwiki.wysiwyg.client.selection.internal.AbstractRange
compareBoundaryPoints, getJSRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

cloneContents

public DocumentFragment cloneContents()
Description copied from interface: Range
Duplicates the contents of a Range.

Returns:
A DocumentFragment that contains content equivalent to this Range.

cloneRange

public Range cloneRange()
Description copied from interface: Range
Produces a new Range whose boundary-points are equal to the boundary-points of the Range.

Returns:
The duplicated Range.

collapse

public void collapse(boolean toStart)
Description copied from interface: Range
Collapse a Range onto one of its boundary-points.

Parameters:
toStart - If true, collapses the Range onto its start; if false, collapses it onto its end.

compareBoundaryPoints

protected short compareBoundaryPoints(int how,
                                      com.google.gwt.core.client.JavaScriptObject sourceRange)
Specified by:
compareBoundaryPoints in class AbstractRange

deleteContents

public void deleteContents()
Description copied from interface: Range
Removes the contents of a Range from the containing document or document fragment without returning a reference to the removed content.


detach

public void detach()
Description copied from interface: Range
Called to indicate that the Range is no longer in use and that the implementation may relinquish any resources associated with this Range.


extractContents

public DocumentFragment extractContents()
Description copied from interface: Range
Moves the contents of a Range from the containing document or document fragment to a new DocumentFragment.

Returns:
A DocumentFragment containing the extracted contents.

getCommonAncestorContainer

public com.google.gwt.dom.client.Node getCommonAncestorContainer()
Returns:
The deepest common ancestor container of the Range's two boundary-points.

getEndContainer

public com.google.gwt.dom.client.Node getEndContainer()
Returns:
Node within which the Range ends.

getEndOffset

public int getEndOffset()
Returns:
Offset within the ending node of the Range.

getStartContainer

public com.google.gwt.dom.client.Node getStartContainer()
Returns:
Node within which the Range begins.

getStartOffset

public int getStartOffset()
Returns:
Offset within the starting node of the Range.

insertNode

public void insertNode(com.google.gwt.dom.client.Node newNode)
Description copied from interface: Range
Inserts a node into the Document or DocumentFragment at the start of the Range. If the container is a Text node, this will be split at the start of the Range (as if the Text node's splitText method was performed at the insertion point) and the insertion will occur between the two resulting Text nodes. Adjacent Text nodes will not be automatically merged. If the node to be inserted is a DocumentFragment node, the children will be inserted rather than the DocumentFragment node itself.

Parameters:
newNode - The node to insert at the start of the Range.

isCollapsed

public boolean isCollapsed()
Returns:
true if the Range is collapsed.

selectNode

public void selectNode(com.google.gwt.dom.client.Node refNode)
Description copied from interface: Range
Select a node and its contents.

Parameters:
refNode - The node to select.

selectNodeContents

public void selectNodeContents(com.google.gwt.dom.client.Node refNode)
Description copied from interface: Range
Select the contents within a node.

Parameters:
refNode - Node to select from.

setEnd

public void setEnd(com.google.gwt.dom.client.Node refNode,
                   int offset)
Description copied from interface: Range
Sets the attributes describing the end of a Range.

Parameters:
refNode - The refNode value. This parameter must be different from null.
offset - The endOffset value.

setEndAfter

public void setEndAfter(com.google.gwt.dom.client.Node refNode)
Description copied from interface: Range
Sets the end of a Range to be after a node.

Parameters:
refNode - Range ends after refNode.

setEndBefore

public void setEndBefore(com.google.gwt.dom.client.Node refNode)
Description copied from interface: Range
Sets the end position to be before a node.

Parameters:
refNode - Range ends before refNode.

setStart

public void setStart(com.google.gwt.dom.client.Node refNode,
                     int offset)
Description copied from interface: Range
Sets the attributes describing the start of the Range.

Parameters:
refNode - The refNode value. This parameter must be different from null.
offset - The startOffset value.

setStartAfter

public void setStartAfter(com.google.gwt.dom.client.Node refNode)
Description copied from interface: Range
Sets the start position to be after a node.

Parameters:
refNode - Range starts after refNode.

setStartBefore

public void setStartBefore(com.google.gwt.dom.client.Node refNode)
Description copied from interface: Range
Sets the start position to be before a node.

Parameters:
refNode - Range starts before refNode.

surroundContents

public void surroundContents(com.google.gwt.dom.client.Node newParent)
Description copied from interface: Range
Re-parents the contents of the Range to the given node and inserts the node at the position of the start of the Range.

Parameters:
newParent - The node to surround the contents with.

toString

public java.lang.String toString()
Description copied from interface: Range
Returns the contents of a Range as a string. This string contains only the data characters, not any mark-up.

Specified by:
toString in interface Range
Overrides:
toString in class java.lang.Object
Returns:
The contents of the Range.


Copyright © 2004-2008 XWiki. All Rights Reserved.