本文整理了Java中com.gargoylesoftware.htmlunit.WebClient.getPromptHandler()
方法的一些代码示例,展示了WebClient.getPromptHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.getPromptHandler()
方法的具体详情如下:
包路径:com.gargoylesoftware.htmlunit.WebClient
类名称:WebClient
方法名:getPromptHandler
[英]Returns the prompt handler.
[中]
代码示例来源:origin: net.disy.htmlunit/htmlunit
/**
* The JavaScript function "prompt()".
* @param message the message
* @return true if ok was pressed, false if cancel was pressed
*/
public String jsxFunction_prompt(final String message) {
final PromptHandler handler = getWebWindow().getWebClient().getPromptHandler();
if (handler == null) {
LOG.warn("window.prompt(\"" + message + "\") no prompt handler installed");
return null;
}
return handler.handlePrompt(document_.getHtmlPage(), message);
}
代码示例来源:origin: org.jvnet.hudson/htmlunit
/**
* The JavaScript function "prompt()".
* @param message the message
* @return true if ok was pressed, false if cancel was pressed
*/
public String jsxFunction_prompt(final String message) {
final PromptHandler handler = getWebWindow().getWebClient().getPromptHandler();
if (handler == null) {
LOG.warn("window.prompt(\"" + message + "\") no prompt handler installed");
return null;
}
return handler.handlePrompt(document_.getHtmlPage(), message);
}
代码示例来源:origin: org.jenkins-ci/htmlunit
/**
* The JavaScript function "prompt()".
* @param message the message
* @return true if ok was pressed, false if cancel was pressed
*/
public String jsxFunction_prompt(final String message) {
final PromptHandler handler = getWebWindow().getWebClient().getPromptHandler();
if (handler == null) {
LOG.warn("window.prompt(\"" + message + "\") no prompt handler installed");
return null;
}
return handler.handlePrompt(document_.getHtmlPage(), message);
}
代码示例来源:origin: net.sourceforge.htmlunit/htmlunit
/**
* The JavaScript function {@code prompt}.
* @param message the message
* @param defaultValue the default value displayed in the text input field
* @return the value typed in or {@code null} if the user pressed {@code cancel}
*/
@JsxFunction
public String prompt(final String message, Object defaultValue) {
final PromptHandler handler = getWebWindow().getWebClient().getPromptHandler();
if (handler == null) {
LOG.warn("window.prompt(\"" + message + "\") no prompt handler installed");
return null;
}
if (defaultValue == Undefined.instance) {
defaultValue = null;
}
else {
defaultValue = Context.toString(defaultValue);
}
return handler.handlePrompt(document_.getPage(), message, (String) defaultValue);
}
代码示例来源:origin: HtmlUnit/htmlunit
/**
* The JavaScript function {@code prompt}.
* @param message the message
* @param defaultValue the default value displayed in the text input field
* @return the value typed in or {@code null} if the user pressed {@code cancel}
*/
@JsxFunction
public String prompt(final String message, Object defaultValue) {
final PromptHandler handler = getWebWindow().getWebClient().getPromptHandler();
if (handler == null) {
LOG.warn("window.prompt(\"" + message + "\") no prompt handler installed");
return null;
}
if (defaultValue == Undefined.instance) {
defaultValue = null;
}
else {
defaultValue = Context.toString(defaultValue);
}
return handler.handlePrompt(document_.getPage(), message, (String) defaultValue);
}
内容来源于网络,如有侵权,请联系作者删除!