Java Code Examples for com.gargoylesoftware.htmlunit.html.DomNode#setTextContent()

The following examples show how to use com.gargoylesoftware.htmlunit.html.DomNode#setTextContent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HTMLAnchorElement.java    From htmlunit with Apache License 2.0 4 votes vote down vote up
/**
 * Sets the {@code text} attribute.
 * @param text the {@code text} attribute
 */
@JsxSetter
public void setText(final String text) {
    final DomNode htmlElement = getDomNodeOrDie();
    htmlElement.setTextContent(text);
}
 
Example 2
Source File: XMLDOMNode.java    From htmlunit with Apache License 2.0 4 votes vote down vote up
/**
 * Replace all child elements of this element by the supplied text.
 * @param text the new text of this node
 */
@JsxSetter
public void setText(final Object text) {
    final DomNode domNode = getDomNodeOrDie();
    domNode.setTextContent(text == null ? null : Context.toString(text));
}
 
Example 3
Source File: HTMLAnchorElement.java    From HtmlUnit-Android with Apache License 2.0 4 votes vote down vote up
/**
 * Sets the {@code text} attribute.
 * @param text the {@code text} attribute
 */
@JsxSetter
public void setText(final String text) {
    final DomNode htmlElement = getDomNodeOrDie();
    htmlElement.setTextContent(text);
}
 
Example 4
Source File: XMLDOMNode.java    From HtmlUnit-Android with Apache License 2.0 4 votes vote down vote up
/**
 * Replace all child elements of this element by the supplied text.
 * @param text the new text of this node
 */
@JsxSetter
public void setText(final Object text) {
    final DomNode domNode = getDomNodeOrDie();
    domNode.setTextContent(text == null ? null : Context.toString(text));
}