本文整理了Java中org.eclipse.swt.browser.Browser.close()
方法的一些代码示例,展示了Browser.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Browser.close()
方法的具体详情如下:
包路径:org.eclipse.swt.browser.Browser
类名称:Browser
方法名:close
[英]Attempts to dispose the receiver, but allows the dispose to be vetoed by the user in response to an onbeforeunload
listener in the Browser's current page.
[中]尝试处置接收器,但允许用户在浏览器当前页面中响应onbeforeunload
侦听器时否决处置。
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Ask for user Agent of the available browser.
*
* @return a string that contains the user agent of the browser.
*/
protected String getUserAgent() {
Browser browser;
try {
browser = new Browser( new Shell(), SWT.NONE );
} catch ( SWTError e ) {
log.logError( "Could not open a browser", e );
return "";
}
String userAgent = browser.evaluate( "return window.navigator.userAgent;" ).toString();
browser.close();
return userAgent;
}
代码示例来源:origin: openaudible/openaudible
public void close() {
if (!isDisposed()) browser.close();
browser = null;
browserWebClient.close();
}
内容来源于网络,如有侵权,请联系作者删除!