com.gargoylesoftware.htmlunit.javascript.host.Window.setDomNode()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 JavaScript  
字(4.1k)|赞(0)|评价(0)|浏览(262)

本文整理了Java中com.gargoylesoftware.htmlunit.javascript.host.Window.setDomNode()方法的一些代码示例,展示了Window.setDomNode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.setDomNode()方法的具体详情如下:
包路径:com.gargoylesoftware.htmlunit.javascript.host.Window
类名称:Window
方法名:setDomNode

Window.setDomNode介绍

暂无

代码示例

代码示例来源:origin: net.disy.htmlunit/htmlunit

/**
 * Initialize the object.
 * @param enclosedPage the page containing the JavaScript
 */
public void initialize(final Page enclosedPage) {
  if (enclosedPage instanceof HtmlPage) {
    final HtmlPage htmlPage = (HtmlPage) enclosedPage;
    // Windows don't have corresponding DomNodes so set the domNode
    // variable to be the page. If this isn't set then SimpleScriptable.get()
    // won't work properly
    setDomNode(htmlPage);
    eventListenersContainer_ = null;
    WebAssert.notNull("document_", document_);
    document_.setDomNode(htmlPage);
  }
}

代码示例来源:origin: org.jvnet.hudson/htmlunit

/**
 * Initialize the object.
 * @param enclosedPage the page containing the JavaScript
 */
public void initialize(final Page enclosedPage) {
  if (enclosedPage instanceof HtmlPage) {
    final HtmlPage htmlPage = (HtmlPage) enclosedPage;
    // Windows don't have corresponding DomNodes so set the domNode
    // variable to be the page. If this isn't set then SimpleScriptable.get()
    // won't work properly
    setDomNode(htmlPage);
    eventListenersContainer_ = null;
    WebAssert.notNull("document_", document_);
    document_.setDomNode(htmlPage);
  }
}

代码示例来源:origin: org.jenkins-ci/htmlunit

/**
 * Initialize the object.
 * @param enclosedPage the page containing the JavaScript
 */
public void initialize(final Page enclosedPage) {
  if (enclosedPage instanceof HtmlPage) {
    final HtmlPage htmlPage = (HtmlPage) enclosedPage;
    // Windows don't have corresponding DomNodes so set the domNode
    // variable to be the page. If this isn't set then SimpleScriptable.get()
    // won't work properly
    setDomNode(htmlPage);
    eventListenersContainer_ = null;
    WebAssert.notNull("document_", document_);
    document_.setDomNode(htmlPage);
  }
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Initialize the object.
 * @param enclosedPage the page containing the JavaScript
 */
public void initialize(final Page enclosedPage) {
  if (enclosedPage != null && enclosedPage.isHtmlPage()) {
    final HtmlPage htmlPage = (HtmlPage) enclosedPage;
    // Windows don't have corresponding DomNodes so set the domNode
    // variable to be the page. If this isn't set then SimpleScriptable.get()
    // won't work properly
    setDomNode(htmlPage);
    clearEventListenersContainer();
    WebAssert.notNull("document_", document_);
    document_.setDomNode(htmlPage);
  }
}

代码示例来源:origin: HtmlUnit/htmlunit

/**
 * Initialize the object.
 * @param enclosedPage the page containing the JavaScript
 */
public void initialize(final Page enclosedPage) {
  if (enclosedPage != null && enclosedPage.isHtmlPage()) {
    final HtmlPage htmlPage = (HtmlPage) enclosedPage;
    // Windows don't have corresponding DomNodes so set the domNode
    // variable to be the page. If this isn't set then SimpleScriptable.get()
    // won't work properly
    setDomNode(htmlPage);
    clearEventListenersContainer();
    WebAssert.notNull("document_", document_);
    document_.setDomNode(htmlPage);
  }
}

代码示例来源:origin: net.disy.legato/legato-testing

@SuppressWarnings("deprecation")
protected Scriptable getWindow() {
  final WebClient webClient = new WebClient(getBrowserVersion());
  final WebWindow webWindow = webClient.openWindow(null, "main");
  final Window window = (Window) webWindow.getScriptObject();
  final WebResponse webResponse = new StringWebResponse(getPageString(),
      getPageURL());
  HtmlPage page = null;
  try {
    page = HTMLParser.parseHtml(webResponse, webWindow);
  } catch (final IOException ioex) {
    throw new AssertionError(ioex);
  }
  window.setDomNode(page);
  return window;
  
  //return window;
}

代码示例来源:origin: net.disy.htmlunit/htmlunit

if (openerPage != null) {
  final Window jsWindow = (Window) window.getScriptObject();
  jsWindow.setDomNode(openerPage);
  jsWindow.jsxGet_document().setDomNode(openerPage);

代码示例来源:origin: org.jvnet.hudson/htmlunit

if (openerPage != null) {
  final Window jsWindow = (Window) window.getScriptObject();
  jsWindow.setDomNode(openerPage);
  jsWindow.jsxGet_document().setDomNode(openerPage);

代码示例来源:origin: org.jenkins-ci/htmlunit

if (openerPage != null) {
  final Window jsWindow = (Window) window.getScriptObject();
  jsWindow.setDomNode(openerPage);
  jsWindow.jsxGet_document().setDomNode(openerPage);

相关文章

微信公众号