public class Range extends SimpleScriptable
Modifier and Type | Field and Description |
---|---|
static short |
END_TO_END
Comparison mode for compareBoundaryPoints.
|
static short |
END_TO_START
Comparison mode for compareBoundaryPoints.
|
static short |
START_TO_END
Comparison mode for compareBoundaryPoints.
|
static short |
START_TO_START
Comparison mode for compareBoundaryPoints.
|
Constructor and Description |
---|
Range()
Creates a new instance.
|
Range(HTMLDocument document)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
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_compareBoundaryPoints(int how,
Range sourceRange)
Compares the boundary points of two Ranges.
|
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. |
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
applyDescriptorToAttributeBitset, 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, size
public static final short START_TO_START
public static final short START_TO_END
public static final short END_TO_END
public static final short END_TO_START
public Range()
public Range(HTMLDocument document)
document
- the HTML document creating the rangepublic 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 fragmentpublic Object jsxFunction_extractContents()
public SimpleRange toW3C()
Range
version of this object.Range
version of this objectpublic Object jsxFunction_compareBoundaryPoints(int how, Range sourceRange)
how
- a constant describing the comparison methodsourceRange
- the Range to compare boundary points with this rangeCopyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.