public class TextRange extends SimpleScriptable
| Constructor and Description |
|---|
TextRange()
Default constructor used to build the prototype.
|
TextRange(HTMLElement elt)
Constructs a text range around the provided element.
|
TextRange(org.w3c.dom.ranges.Range range)
Constructs a text range around the provided range.
|
| Modifier and Type | Method and Description |
|---|---|
void |
jsxFunction_collapse(boolean toStart)
Collapses the range.
|
Object |
jsxFunction_duplicate()
Duplicates this TextRange instance.
|
boolean |
jsxFunction_inRange(TextRange other)
Indicates if a range is contained in current one.
|
int |
jsxFunction_moveEnd(String unit,
Object count)
Changes the end position of the range.
|
int |
jsxFunction_moveStart(String unit,
Object count)
Changes the start position of the range.
|
void |
jsxFunction_moveToElementText(HTMLElement element)
Moves the text range so that the start and end positions of the range encompass
the text in the specified element.
|
Object |
jsxFunction_parentElement()
Retrieves the parent element for the given text range.
|
void |
jsxFunction_select()
Makes the current range the active selection.
|
void |
jsxFunction_setEndPoint(String type,
TextRange other)
Sets the endpoint of the range based on the endpoint of another range..
|
String |
jsxGet_htmlText()
Retrieves the HTML fragment contained within the range.
|
String |
jsxGet_text()
Retrieves the text contained within the range.
|
void |
jsxSet_text(String text)
Sets the text contained within the range.
|
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElementapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, sizepublic TextRange()
public TextRange(HTMLElement elt)
elt - the element to wrappublic TextRange(org.w3c.dom.ranges.Range range)
range - the initial rangepublic String jsxGet_text()
public void jsxSet_text(String text)
text - the text contained within the rangepublic String jsxGet_htmlText()
public Object jsxFunction_duplicate()
public Object jsxFunction_parentElement()
public void jsxFunction_collapse(boolean toStart)
toStart - indicates if collapse should be done to the startpublic void jsxFunction_select()
public int jsxFunction_moveStart(String unit, Object count)
unit - specifies the units to movecount - the number of units to movepublic int jsxFunction_moveEnd(String unit, Object count)
unit - specifies the units to movecount - the number of units to movepublic void jsxFunction_moveToElementText(HTMLElement element)
element - the element to move topublic boolean jsxFunction_inRange(TextRange other)
other - the other rangetrue if other is contained within current rangepublic void jsxFunction_setEndPoint(String type, TextRange other)
type - end point transfer type. One of "StartToEnd", "StartToStart", "EndToStart" and "EndToEnd"other - the other rangeCopyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.