org.xwiki.gwt.dom.client.internal.mozilla
Class MozillaSelection

java.lang.Object
  extended by org.xwiki.gwt.dom.client.internal.AbstractSelection
      extended by org.xwiki.gwt.dom.client.internal.DefaultSelection
          extended by org.xwiki.gwt.dom.client.internal.mozilla.MozillaSelection
All Implemented Interfaces:
Selection

public class MozillaSelection
extends DefaultSelection

Fixes selection problems found in Firefox versions prior to 3.0.

Version:
$Id: MozillaSelection.java 20039 2009-05-16 12:04:30Z sdumitriu $

Constructor Summary
MozillaSelection(NativeSelection nativeSelection)
          Creates a new selection object.
 
Method Summary
 void addRange(Range range)
          Adds a range to this selection.
protected  int adjustOffset(com.google.gwt.dom.client.Node node, int offset)
          Adjusts the specified offset within the given node to avoid NS_ERROR_DOM_INDEX_SIZE_ERR.
 
Methods inherited from class org.xwiki.gwt.dom.client.internal.DefaultSelection
getNativeSelection, getRangeAt, getRangeCount, removeAllRanges, removeRange
 
Methods inherited from class org.xwiki.gwt.dom.client.internal.AbstractSelection
collapse, collapseToEnd, collapseToStart, containsNode, deleteFromDocument, extend, getAnchorNode, getAnchorOffset, getFocusNode, getFocusOffset, isCollapsed, selectAllChildren, selectionLanguageChange, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MozillaSelection

public MozillaSelection(NativeSelection nativeSelection)
Creates a new selection object.

Parameters:
nativeSelection - the underlying native selection to be used
Method Detail

addRange

public void addRange(Range range)
Adds a range to this selection.

Specified by:
addRange in interface Selection
Overrides:
addRange in class DefaultSelection
Parameters:
range - the range to be added
See Also:
DefaultSelection.addRange(Range)

adjustOffset

protected int adjustOffset(com.google.gwt.dom.client.Node node,
                           int offset)
Adjusts the specified offset within the given node to avoid NS_ERROR_DOM_INDEX_SIZE_ERR.

Parameters:
node - A DOM node.
offset - The offset within the given node.
Returns:
the adjusted value of the specified offset.


Copyright © 2004-2009 XWiki. All Rights Reserved.