@Generated(value="org.realityforge.webtack")
@JsType(isNative=true,
namespace="<global>",
name="Selection")
public class Selection
extends JsObject
| Modifier | Constructor and Description |
|---|---|
protected |
Selection() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRange(Range range)
The Selection.addRange() method adds a Range to a Selection.
|
Node |
anchorNode()
The Selection.anchorNode read-only property returns the Node in which the selection begins.
|
int |
anchorOffset()
The Selection.anchorOffset read-only property returns the number of characters that the selection's anchor is offset within the Selection.anchorNode.
|
void |
collapse(Node node)
The Selection.collapse() method collapses the current selection to a single point.
|
void |
collapse(Node node,
int offset)
The Selection.collapse() method collapses the current selection to a single point.
|
void |
collapseToEnd()
The Selection.collapseToEnd() method collapses the selection to the end of the last range in the selection.
|
void |
collapseToStart()
The Selection.collapseToStart() method collapses the selection to the start of the first range in the selection.
|
boolean |
containsNode(Node node)
The Selection.containsNode() method indicates whether a specfied node is part of the selection.
|
boolean |
containsNode(Node node,
boolean allowPartialContainment)
The Selection.containsNode() method indicates whether a specfied node is part of the selection.
|
void |
deleteFromDocument()
The deleteFromDocument() method of the Selection interface deletes the selected text from the document's DOM.
|
void |
empty()
The Selection.removeAllRanges() method removes all ranges from the selection, leaving the anchorNode and focusNode properties equal to null and leaving nothing selected.
|
void |
extend(Node node)
The Selection.extend() method moves the focus of the selection to a specified point.
|
void |
extend(Node node,
int offset)
The Selection.extend() method moves the focus of the selection to a specified point.
|
Node |
focusNode()
The Selection.focusNode read-only property returns the Node in which the selection ends.
|
int |
focusOffset()
The Selection.focusOffset read-only property returns the number of characters that the selection's focus is offset within the Selection.focusNode.
|
@JsNonNull Range |
getRangeAt(int index)
The Selection.getRangeAt() method returns a range object representing one of the ranges currently selected.
|
boolean |
isCollapsed()
The Selection.isCollapsed read-only property returns a Boolean which indicates whether or not there is currently any text selected.
|
int |
rangeCount()
The Selection.rangeCount read-only property returns the number of ranges in the selection.
|
void |
removeAllRanges()
The Selection.removeAllRanges() method removes all ranges from the selection, leaving the anchorNode and focusNode properties equal to null and leaving nothing selected.
|
void |
removeRange(Range range)
The Selection.removeRange() method removes a range from a selection.
|
void |
selectAllChildren(Node node)
The Selection.selectAllChildren() method adds all the children of the specified node to the selection.
|
void |
setBaseAndExtent(Node anchorNode,
int anchorOffset,
Node focusNode,
int focusOffset)
The setBaseAndExtent() method of the Selection interface sets the selection to be a range including all or parts of two specified DOM nodes, and any content located between them.
|
void |
setPosition(Node node)
The Selection.collapse() method collapses the current selection to a single point.
|
void |
setPosition(Node node,
int offset)
The Selection.collapse() method collapses the current selection to a single point.
|
java.lang.String |
type()
The type read-only property of the Selection interface returns a DOMString describing the type of the current selection.
|
assign, create, create, defineProperties, defineProperty, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyDescriptor, getOwnPropertyDescriptors, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toString_, valueOf_, values@JsProperty(name="anchorNode") @Nullable public Node anchorNode()
@JsProperty(name="anchorOffset") public int anchorOffset()
@JsProperty(name="focusNode") @Nullable public Node focusNode()
@JsProperty(name="focusOffset") public int focusOffset()
@JsProperty(name="isCollapsed") public boolean isCollapsed()
@JsProperty(name="rangeCount") public int rangeCount()
@JsProperty(name="type") @Nonnull public java.lang.String type()
public void addRange(@Nonnull
Range range)
public void collapse(@Nullable
Node node,
int offset)
public void collapse(@Nullable
Node node)
public void collapseToEnd()
public void collapseToStart()
public boolean containsNode(@Nonnull
Node node,
boolean allowPartialContainment)
public boolean containsNode(@Nonnull
Node node)
public void deleteFromDocument()
public void empty()
public void extend(@Nonnull
Node node,
int offset)
public void extend(@Nonnull
Node node)
public @JsNonNull Range getRangeAt(int index)
public void removeAllRanges()
public void removeRange(@Nonnull
Range range)
public void selectAllChildren(@Nonnull
Node node)
public void setBaseAndExtent(@Nonnull
Node anchorNode,
int anchorOffset,
@Nonnull
Node focusNode,
int focusOffset)
public void setPosition(@Nullable
Node node,
int offset)
public void setPosition(@Nullable
Node node)