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.
(要求关闭浏览器。)
|
void |
createImmediately()
Call to immediately create the underlying browser object.
(调用以立即创建基础浏览器对象。)
|
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.
(-强制关闭。)
void createImmediately()
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.
(-UI中应检查的位置。)
CefFrame getFocusedFrame()
CefFrame getFrame(long identifier)
identifier
- The unique frame identifier
(-唯一的帧标识符)
CefFrame getFrame(java.lang.String name)
name
- The specified name
(-指定名称)
int 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.
(-要写入的文件的路径(如果已经存在,将被覆盖)。不能为null。)
settings
- The pdf print settings to use. If null then defaults will be used.
(-要使用的pdf打印设置。如果为null,则将使用默认值。)
callback
- Called when the pdf print job has completed.
(-在pdf打印作业完成时调用。)
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").
(-用于限制可选文件类型,并且可以是(a)有效的小写MIME类型(例如“ text / *”或“ image / *”),(b)单个文件扩展名(例如“ .txt”)的任意组合或“ .png”),或(c)使用“ |”定界的组合说明和文件扩展名和“;” (例如“图片类型| .png; .gif; .jpg”)。)
selectedAcceptFilter
- is the 0-based index of the filter that should be selected by default.
(-是默认情况下应选择的基于0的过滤器索引。)
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 browser
(-设置为true以将焦点集中在浏览器上)
void 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.
(-下载该文件的URL。)
void stopFinding(boolean clearSelection)
clearSelection
- Set to true to reset selection.
(-设置为true以重置选择。)
void stopLoad()
void viewSource()