use of com.gargoylesoftware.htmlunit.html.impl.SimpleRange in project htmlunit by HtmlUnit.
the class Selection method selectAllChildren.
/**
* Adds all the children of the specified node to the selection. The previous selection is lost.
* @param parentNode all children of parentNode will be selected; parentNode itself is not part of the selection
*/
@JsxFunction
public void selectAllChildren(final Node parentNode) {
final List<Range> ranges = getRanges();
ranges.clear();
final SimpleRange rg = new SimpleRange(parentNode.getDomNodeOrDie());
ranges.add(rg);
if (rg.getCollapsed()) {
type_ = TYPE_CARET;
} else {
type_ = TYPE_RANGE;
}
}
Aggregations