org.xwiki.gwt.dom.client.internal.ie
Class NativeRange
java.lang.Object
com.google.gwt.core.client.JavaScriptObject
org.xwiki.gwt.dom.client.internal.ie.NativeRange
- Direct Known Subclasses:
- ControlRange, TextRange
public class NativeRange
- extends com.google.gwt.core.client.JavaScriptObject
Base class for TextRange and ControlRange, the two types of range provided by Internet Explorer.
- Version:
- $Id: NativeRange.java 20039 2009-05-16 12:04:30Z sdumitriu $
|
Constructor Summary |
protected |
NativeRange()
Default constructor. |
|
Method Summary |
Document |
getOwnerDocument()
|
boolean |
isTextRange()
This method is needed because instanceof operator returns true all the time when applied on a
overlay type. |
void |
select()
Makes the selection equal to the current object. |
| Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
cast, createArray, createFunction, createObject, equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
NativeRange
protected NativeRange()
- Default constructor. Needs to be protected because all instances are created from JavaScript.
select
public final void select()
- Makes the selection equal to the current object. When applied to a TextRange object, the select method causes the
current object to be highlighted. When applied to a ControlRange object, the select method produces a shaded
rectangle around the elements in the control range.
getOwnerDocument
public final Document getOwnerDocument()
- Returns:
- The document used to create this range.
isTextRange
public final boolean isTextRange()
- This method is needed because
instanceof operator returns true all the time when applied on a
overlay type. For instance:
TextRange textRange = TextRange.newInstance(doc);
boolean result = textRange instanceof TextRange; // result is true, which is right.
result = textRange instanceof ControlRange // result is also true, which is wrong.
- Returns:
- true if this is a text range, and false if it is a control range.
- See Also:
http://code.google.com/p/google-web-toolkit/wiki/OverlayTypes
Copyright © 2004-2009 XWiki. All Rights Reserved.