|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.core.client.JavaScriptObject org.xwiki.gwt.dom.client.internal.ie.NativeRange
public class NativeRange
Base class for TextRange
and ControlRange
, the two types of range provided by Internet Explorer.
Constructor Summary | |
---|---|
protected |
NativeRange()
Default constructor. |
Method Summary | |
---|---|
static boolean |
areEqual(NativeRange alice,
NativeRange bob)
NOTE: We added this static method for the same reasons we added the duplicate(NativeRange) method. |
static NativeRange |
duplicate(NativeRange range)
NOTE: We had to add this method because overlay types don't support method overriding and both TextRange
and ControlRange have a duplicate method but with a different implementation. |
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, toSource, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected NativeRange()
Method Detail |
---|
public final void select()
public final Document getOwnerDocument()
public final boolean isTextRange()
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.
http://code.google.com/p/google-web-toolkit/wiki/OverlayTypes
public static NativeRange duplicate(NativeRange range)
TextRange
and ControlRange
have a duplicate
method but with a different implementation. Using an abstract
duplicate
method is not an option because overlay types can't implement interfaces and this method can't
return an abstract type. We had to make this method static because only static references to overlay types are
allowed from JSNI.
range
- the native range to be duplicated
public static boolean areEqual(NativeRange alice, NativeRange bob)
duplicate(NativeRange)
method.
alice
- a native rangebob
- a native range
true
if the given native ranges are equal, false
otherwiseduplicate(NativeRange)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |