|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.htmlunit.corejs.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
com.gargoylesoftware.htmlunit.javascript.host.Range
public class Range
The JavaScript object that represents a Range.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary |
---|
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
Range()
Creates a new instance. |
|
Range(HTMLDocument document)
Creates a new instance. |
Method Summary | |
---|---|
Object |
getDefaultValue(Class<?> hint)
Returns the JavaScript default value of this object. |
void |
jsxFunction_collapse(boolean toStart)
Collapse a Range onto one of its boundaries. |
Object |
jsxFunction_createContextualFragment(String valueAsString)
Parses an HTML snippet. |
Object |
jsxFunction_extractContents()
Moves this range's contents from the document tree into a document fragment. |
void |
jsxFunction_selectNode(Node refNode)
Selects a node and its contents. |
void |
jsxFunction_selectNodeContents(Node refNode)
Select the contents within a node. |
void |
jsxFunction_setEnd(Node refNode,
int offset)
Sets the attributes describing the end of a Range. |
void |
jsxFunction_setEndAfter(Node refNode)
Sets the end of the range to be after the node. |
void |
jsxFunction_setEndBefore(Node refNode)
Sets the end of the range to be before the node. |
void |
jsxFunction_setStart(Node refNode,
int offset)
Sets the attributes describing the start of a Range. |
void |
jsxFunction_setStartAfter(Node refNode)
Sets the start of the range to be after the node. |
void |
jsxFunction_setStartBefore(Node refNode)
Sets the start of the range to be before the node. |
boolean |
jsxGet_collapsed()
Indicates if the range is collapsed. |
Object |
jsxGet_commonAncestorContainer()
Returns the deepest common ancestor container of the Range's two boundary points. |
Object |
jsxGet_endContainer()
Gets the node within which the Range ends. |
int |
jsxGet_endOffset()
Gets the offset within the end node of the Range. |
Object |
jsxGet_startContainer()
Gets the node within which the Range begins. |
int |
jsxGet_startOffset()
Gets the offset within the starting node of the Range. |
SimpleRange |
toW3C()
Returns a W3C Range version of this object. |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
---|
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement |
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
---|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public Range()
public Range(HTMLDocument document)
document
- the HTML document creating the rangeMethod Detail |
---|
public Object getDefaultValue(Class<?> hint)
getDefaultValue
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
getDefaultValue
in class SimpleScriptable
hint
- a hint as to the format of the default value (ignored in this case)
public Object jsxGet_startContainer()
undefined
if not initializedpublic Object jsxGet_endContainer()
undefined
if not initializedpublic int jsxGet_startOffset()
0
if not initializedpublic int jsxGet_endOffset()
0
if not initializedpublic void jsxFunction_setStart(Node refNode, int offset)
refNode
- the reference nodeoffset
- the offset value within the nodepublic void jsxFunction_setStartAfter(Node refNode)
refNode
- the reference nodepublic void jsxFunction_setStartBefore(Node refNode)
refNode
- the reference nodepublic boolean jsxGet_collapsed()
true
if the range is collapsedpublic void jsxFunction_setEnd(Node refNode, int offset)
refNode
- the reference nodeoffset
- the offset value within the nodepublic void jsxFunction_setEndAfter(Node refNode)
refNode
- the reference nodepublic void jsxFunction_setEndBefore(Node refNode)
refNode
- the reference nodepublic void jsxFunction_selectNodeContents(Node refNode)
refNode
- Node to select frompublic void jsxFunction_selectNode(Node refNode)
refNode
- the node to selectpublic void jsxFunction_collapse(boolean toStart)
toStart
- if true
, collapses the Range onto its start; else collapses it onto its endpublic Object jsxGet_commonAncestorContainer()
public Object jsxFunction_createContextualFragment(String valueAsString)
valueAsString
- text that contains text and tags to be converted to a document fragment
public Object jsxFunction_extractContents()
public SimpleRange toW3C()
Range
version of this object.
Range
version of this object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |