public interface CefBrowser
限定符和类型 | 方法和说明 |
---|---|
boolean |
canGoBack()
Tests if the browser can navigate backwards. (测试浏览器是否可以向后导航)
|
boolean |
canGoForward()
Tests if the browser can navigate forwards. (测试浏览器是否可以向前导航)
|
void |
close(boolean force)
Request that the browser close. (请求浏览器关闭)
|
boolean |
doClose()
Called from CefClient.doClose. (被CefClient.doClose调用)
|
void |
executeJavaScript(java.lang.String code,
java.lang.String url,
int line)
Execute a string of JavaScript code in this frame. (在此框架中执行一串JavaScript代码)
|
void |
find(int identifier,
java.lang.String searchText,
boolean forward,
boolean matchCase,
boolean findNext)
Search for some kind of text on the page. (在页面上搜索某种文本)
|
CefClient |
getClient()
Get the client associated with this browser. (获取与此浏览器关联的客户端)
|
CefBrowser |
getDevTools()
Get an instance of the dev tools to be displayed in its own window or to be
embedded within your UI. (获取要在其自己的窗口中显示或嵌入UI中的开发工具的实例)
|
CefBrowser |
getDevTools(java.awt.Point inspectAt)
Get an instance of the dev tools to be displayed in its own window or to be
embedded within your UI. (获取要在其自己的窗口中显示或嵌入UI中的开发工具的实例)
|
CefFrame |
getFocusedFrame()
Returns the focused frame for the browser window. (返回浏览器窗口的焦点框架)
|
CefFrame |
getFrame(long identifier)
Returns the frame with the specified identifier, or NULL if not found. (返回具有指定标识符的帧,如果未找到,则返回NULL)
|
CefFrame |
getFrame(java.lang.String name)
Returns the frame with the specified name, or NULL if not found. (返回具有指定名称的帧,如果未找到,则返回NULL)
|
int |
getFrameCount()
Returns the number of frames that currently exist. (返回当前存在的帧数)
|
java.util.Vector<java.lang.Long> |
getFrameIdentifiers()
Returns the identifiers of all existing frames. (返回所有现有帧的标识符)
|
java.util.Vector<java.lang.String> |
getFrameNames()
Returns the names of all existing frames. (返回所有现有帧的名称)
|
int |
getIdentifier()
Returns the unique browser identifier. (返回唯一的浏览器标识符)
|
CefFrame |
getMainFrame()
Returns the main (top-level) frame for the browser window. (返回浏览器窗口的主(顶级)框架)
|
CefRenderHandler |
getRenderHandler()
Get an implementation of CefRenderHandler if any. (如果有的话,获取CefRenderHandler的实现)
|
void |
getSource(CefStringVisitor visitor)
Retrieve this frame's HTML source as a string sent to the specified
visitor. (以发送给指定访问者的字符串的形式检索此框架的HTML源代码)
|
void |
getText(CefStringVisitor visitor)
Retrieve this frame's display text as a string sent to the specified
visitor. (将此框架的显示文本检索为发送给指定访问者的字符串)
|
java.awt.Component |
getUIComponent()
Get the underlying UI component (e.g. java.awt.Canvas). (获取底层UI组件(例如java.awt.Canvas))
|
java.lang.String |
getURL()
Emits the URL currently loaded in this frame. (发出当前在此框架中加载的URL)
|
CefWindowHandler |
getWindowHandler()
Get an implementation of CefWindowHandler if any. (如果有的话,获取CefWindowHandler的实现)
|
double |
getZoomLevel()
Get the current zoom level. (获取当前缩放级别)
|
void |
goBack()
Go back. (返回)
|
void |
goForward()
Go forward. (前进)
|
boolean |
hasDocument()
Tests if a document has been loaded in the browser. (测试文档是否已在浏览器中加载)
|
boolean |
isLoading()
Tests if the browser is currently loading. (测试浏览器当前是否正在加载)
|
boolean |
isPopup()
Tests if the window is a popup window. (测试窗口是否为弹出窗口)
|
void |
loadRequest(CefRequest request)
Load the request represented by the request object. (加载请求对象表示的请求)
|
void |
loadString(java.lang.String val,
java.lang.String url)
Load the contents of val with the specified dummy url. (使用指定的虚拟URL加载val的内容)
|
void |
loadURL(java.lang.String url)
Load the specified URL in the main frame. (在主框架中加载指定的URL)
|
void |
onBeforeClose()
Called from CefClient.onBeforeClose. (从CefClient.onBeforeClose调用)
|
void |
print()
Print the current browser contents. (打印当前的浏览器内容)
|
void |
printToPDF(java.lang.String path,
CefPdfPrintSettings settings,
CefPdfPrintCallback callback)
Print the current browser contents to a PDF. (将当前浏览器内容打印为PDF)
|
void |
reload()
Reload the current page. (重新加载当前页面)
|
void |
reloadIgnoreCache()
Reload the current page ignoring any cached data. (重新加载当前页面,忽略任何缓存数据)
|
void |
replaceMisspelling(java.lang.String word)
If a misspelled word is currently selected in an editable node calling
this method will replace it with the specified |word|. (如果当前在可编辑节点中选择了拼写错误的单词,则调用此方法将使用指定的| word |替换它)
|
void |
runFileDialog(CefDialogHandler.FileDialogMode mode,
java.lang.String title,
java.lang.String defaultFilePath,
java.util.Vector<java.lang.String> acceptFilters,
int selectedAcceptFilter,
CefRunFileDialogCallback callback)
Call to run a file chooser dialog. (调用运行文件选择器对话框)
|
void |
setCloseAllowed()
Allow the browser to close. (允许浏览器关闭)
|
void |
setFocus(boolean enable)
Set or remove keyboard focus to/from the browser window. (在浏览器窗口中设置或删除键盘焦点)
|
void |
setWindowVisibility(boolean visible)
Set whether the window containing the browser is visible
(minimized/unminimized, app hidden/unhidden, etc). (设置包含浏览器的窗口是否可见(最小化/未最小化,应用程序隐藏/取消隐藏等))
|
void |
setZoomLevel(double zoomLevel)
Change the zoom level to the specified value. (将缩放级别更改为指定的值)
|
void |
startDownload(java.lang.String url)
Download the file at url using CefDownloadHandler. (使用CefDownloadHandler在url下载文件)
|
void |
stopFinding(boolean clearSelection)
Cancel all searches that are currently going on. (取消当前正在进行的所有搜索)
|
void |
stopLoad()
Stop loading the page. (停止加载页面)
|
void |
viewSource()
Save this frame's HTML source to a temporary file and open it in the
default text viewing application. (将此框架的HTML源保存到临时文件,并在默认文本查看应用程序中打开它)
|
boolean canGoBack()
boolean canGoForward()
void close(boolean force)
force
- force the close.boolean doClose()
void executeJavaScript(java.lang.String code, java.lang.String url, int line)
code
- The code to be executed.url
- The URL where the script in question can be found.line
- The base line number to use for error reporting.void find(int identifier, java.lang.String searchText, boolean forward, boolean matchCase, boolean findNext)
identifier
- can be used to have multiple searches running simultaniously.searchText
- to be searched for.forward
- indicates whether to search forward or backward within the page.matchCase
- indicates whether the search should be case-sensitive.findNext
- indicates whether this is the first request or a follow-up.CefClient getClient()
CefBrowser getDevTools()
CefBrowser getDevTools(java.awt.Point inspectAt)
inspectAt
- a position in the UI which should be inspected.CefFrame getFocusedFrame()
CefFrame getFrame(long identifier)
identifier
- The unique frame identifierCefFrame getFrame(java.lang.String name)
name
- The specified nameint getFrameCount()
java.util.Vector<java.lang.Long> getFrameIdentifiers()
java.util.Vector<java.lang.String> getFrameNames()
int getIdentifier()
CefFrame getMainFrame()
CefRenderHandler getRenderHandler()
void getSource(CefStringVisitor visitor)
visitor
- void getText(CefStringVisitor visitor)
visitor
- java.awt.Component getUIComponent()
java.lang.String getURL()
CefWindowHandler getWindowHandler()
double getZoomLevel()
void goBack()
void goForward()
boolean hasDocument()
boolean isLoading()
boolean isPopup()
void loadRequest(CefRequest request)
request
- The request object.void loadString(java.lang.String val, java.lang.String url)
val
- Content to be displayed.url
- dummy url to be used for.void loadURL(java.lang.String url)
url
- The URL to load.void onBeforeClose()
void print()
void printToPDF(java.lang.String path, CefPdfPrintSettings settings, CefPdfPrintCallback callback)
path
- The path of the file to write to (will be overwritten if it
already exists). Cannot be null.settings
- The pdf print settings to use. If null then defaults
will be used.callback
- Called when the pdf print job has completed.void reload()
void reloadIgnoreCache()
void replaceMisspelling(java.lang.String word)
word
- replace selected word with this word.void runFileDialog(CefDialogHandler.FileDialogMode mode, java.lang.String title, java.lang.String defaultFilePath, java.util.Vector<java.lang.String> acceptFilters, int selectedAcceptFilter, CefRunFileDialogCallback callback)
mode
- represents the type of dialog to display.title
- to be used for the dialog and may be empty to show the
default title ("Open" or "Save" depending on the mode).defaultFilePath
- is the path with optional directory and/or file name
component that should be initially selected in the dialog.acceptFilters
- are used to restrict the selectable file types and may
any combination of (a) valid lower-cased MIME types (e.g. "text/*" or
"image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), or (c)
combined description and file extension delimited using "|" and ";" (e.g.
"Image Types|.png;.gif;.jpg").selectedAcceptFilter
- is the 0-based index of the filter that should
be selected by default.callback
- will be executed after the dialog is dismissed or
immediately if another dialog is already pending.void setCloseAllowed()
void setFocus(boolean enable)
enable
- set to true to give the focus to the browservoid setWindowVisibility(boolean visible)
visible
- void setZoomLevel(double zoomLevel)
zoomLevel
- The zoom level to be set.void startDownload(java.lang.String url)
url
- URL to download that file.void stopFinding(boolean clearSelection)
clearSelection
- Set to true to reset selection.void stopLoad()
void viewSource()