public class CefClient extends CefClientHandler implements CefContextMenuHandler, CefDialogHandler, CefDisplayHandler, CefDownloadHandler, CefDragHandler, CefFocusHandler, CefJSDialogHandler, CefKeyboardHandler, CefLifeSpanHandler, CefLoadHandler, CefPrintHandler, CefRenderHandler, CefRequestHandler, CefWindowHandler
CefDialogHandler.FileDialogModeCefDragHandler.DragOperationMaskCefFocusHandler.FocusSourceCefJSDialogHandler.JSDialogTypeCefKeyboardHandler.CefKeyEventCefLoadHandler.ErrorCodeCefRequestHandler.TerminationStatus| Modifier and Type | Method and Description |
|---|---|
CefClient |
addContextMenuHandler(CefContextMenuHandler handler) |
CefClient |
addDialogHandler(CefDialogHandler handler) |
CefClient |
addDisplayHandler(CefDisplayHandler handler) |
CefClient |
addDownloadHandler(CefDownloadHandler handler) |
CefClient |
addDragHandler(CefDragHandler handler) |
CefClient |
addFocusHandler(CefFocusHandler handler) |
CefClient |
addJSDialogHandler(CefJSDialogHandler handler) |
CefClient |
addKeyboardHandler(CefKeyboardHandler handler) |
CefClient |
addLifeSpanHandler(CefLifeSpanHandler handler) |
CefClient |
addLoadHandler(CefLoadHandler handler) |
void |
addMessageRouter(CefMessageRouter messageRouter) |
void |
addOnPaintListener(java.util.function.Consumer<CefPaintEvent> listener)
Add provided listener.
|
CefClient |
addPrintHandler(CefPrintHandler handler) |
CefClient |
addRequestHandler(CefRequestHandler handler) |
CefBrowser |
createBrowser(java.lang.String url,
boolean isOffscreenRendered,
boolean isTransparent) |
CefBrowser |
createBrowser(java.lang.String url,
boolean isOffscreenRendered,
boolean isTransparent,
CefRequestContext context) |
CefBrowser |
createBrowser(java.lang.String url,
boolean isOffscreenRendered,
boolean isTransparent,
CefRequestContext context,
CefBrowserSettings settings) |
void |
dispose() |
boolean |
doClose(CefBrowser browser)
Called when a browser has received a request to close.
|
protected java.lang.Object[] |
getAllBrowser()
Returns a list of all browser instances.
|
boolean |
getAuthCredentials(CefBrowser browser,
java.lang.String origin_url,
boolean isProxy,
java.lang.String host,
int port,
java.lang.String realm,
java.lang.String scheme,
CefAuthCallback callback)
Called on the IO thread when the browser needs credentials from the user.
|
protected CefBrowser |
getBrowser(int identifier)
Returns the java part of the browser implementation.
|
protected CefContextMenuHandler |
getContextMenuHandler()
Return the handler for context menus.
|
protected CefDialogHandler |
getDialogHandler()
Return the handler for dialogs.
|
protected CefDisplayHandler |
getDisplayHandler()
Return the handler for browser display state events.
|
protected CefDownloadHandler |
getDownloadHandler()
Return the handler for download events.
|
protected CefDragHandler |
getDragHandler()
Return the handler for drag events.
|
protected CefFocusHandler |
getFocusHandler()
Return the handler for focus events.
|
protected CefJSDialogHandler |
getJSDialogHandler()
Return the handler for javascript dialog requests.
|
protected CefKeyboardHandler |
getKeyboardHandler()
Return the handler for keyboard events.
|
protected CefLifeSpanHandler |
getLifeSpanHandler()
Return the handler for browser life span events.
|
protected CefLoadHandler |
getLoadHandler()
Return the handler for browser load status events.
|
java.awt.Dimension |
getPdfPaperSize(CefBrowser browser,
int deviceUnitsPerInch)
Called to retrieve the page size when printToPDF is requested for a browser.
|
protected CefPrintHandler |
getPrintHandler()
Return the handler for printing on Linux.
|
java.awt.Rectangle |
getRect(CefBrowser browser)
Retrieve the view rectangle.
|
protected CefRenderHandler |
getRenderHandler()
Return the handler for off-screen rendering events.
|
protected CefRequestHandler |
getRequestHandler()
Return the handler for browser request events.
|
CefResourceRequestHandler |
getResourceRequestHandler(CefBrowser browser,
CefFrame frame,
CefRequest request,
boolean isNavigation,
boolean isDownload,
java.lang.String requestInitiator,
BoolRef disableDefaultHandling)
Called on the IO thread before a resource request is initiated.
|
boolean |
getScreenInfo(CefBrowser arg0,
CefScreenInfo arg1)
Retrieve the screen info.
|
java.awt.Point |
getScreenPoint(CefBrowser browser,
java.awt.Point viewPoint)
Retrieve the screen point for the specified view point.
|
java.awt.Rectangle |
getViewRect(CefBrowser browser)
Retrieve the view rectangle.
|
protected CefWindowHandler |
getWindowHandler()
Return the handler for windowed rendering events.
|
void |
onAddressChange(CefBrowser browser,
CefFrame frame,
java.lang.String url)
Browser address changed.
|
void |
onAfterCreated(CefBrowser browser)
Handle creation of a new browser window.
|
void |
onAfterParentChanged(CefBrowser browser)
Called after a browser's native parent window has changed.
|
boolean |
onBeforeBrowse(CefBrowser browser,
CefFrame frame,
CefRequest request,
boolean user_gesture,
boolean is_redirect)
Called on the UI thread before browser navigation.
|
void |
onBeforeClose(CefBrowser browser)
Called just before a browser is destroyed.
|
void |
onBeforeContextMenu(CefBrowser browser,
CefFrame frame,
CefContextMenuParams params,
CefMenuModel model)
Called before a context menu is displayed.
|
boolean |
onBeforeDownload(CefBrowser browser,
CefDownloadItem downloadItem,
java.lang.String suggestedName,
CefBeforeDownloadCallback callback)
Called before a download begins.
|
boolean |
onBeforePopup(CefBrowser browser,
CefFrame frame,
java.lang.String target_url,
java.lang.String target_frame_name)
Called on the IO thread before a new popup window is created.
|
boolean |
onBeforeUnloadDialog(CefBrowser browser,
java.lang.String message_text,
boolean is_reload,
CefJSDialogCallback callback)
Called to run a dialog asking the user if they want to leave a page.
|
boolean |
onCertificateError(CefBrowser browser,
CefLoadHandler.ErrorCode cert_error,
java.lang.String request_url,
CefCallback callback)
Called on the UI thread to handle requests for URLs with an invalid SSL certificate.
|
boolean |
onConsoleMessage(CefBrowser browser,
CefSettings.LogSeverity level,
java.lang.String message,
java.lang.String source,
int line)
Display a console message.
|
boolean |
onContextMenuCommand(CefBrowser browser,
CefFrame frame,
CefContextMenuParams params,
int commandId,
int eventFlags)
Called to execute a command selected from the context menu.
|
void |
onContextMenuDismissed(CefBrowser browser,
CefFrame frame)
Called when the context menu is dismissed irregardless of whether the menu
was empty or a command was selected.
|
boolean |
onCursorChange(CefBrowser browser,
int cursorType)
Handle cursor changes.
|
void |
onDialogClosed(CefBrowser browser)
Called when the default implementation dialog is closed.
|
void |
onDownloadUpdated(CefBrowser browser,
CefDownloadItem downloadItem,
CefDownloadItemCallback callback)
Called when a download's status or progress information has been updated.
|
boolean |
onDragEnter(CefBrowser browser,
CefDragData dragData,
int mask)
Called when an external drag event enters the browser window.
|
boolean |
onFileDialog(CefBrowser browser,
CefDialogHandler.FileDialogMode mode,
java.lang.String title,
java.lang.String defaultFilePath,
java.util.Vector<java.lang.String> acceptFilters,
java.util.Vector<java.lang.String> acceptExtensions,
java.util.Vector<java.lang.String> acceptDescriptions,
CefFileDialogCallback callback)
Called to run a file chooser dialog.
|
void |
onFullscreenModeChange(CefBrowser browser,
boolean fullscreen)
Browser fullscreen mode changed.
|
void |
onGotFocus(CefBrowser browser)
Called when the browser component has received focus.
|
boolean |
onJSDialog(CefBrowser browser,
java.lang.String origin_url,
CefJSDialogHandler.JSDialogType dialog_type,
java.lang.String message_text,
java.lang.String default_prompt_text,
CefJSDialogCallback callback,
BoolRef suppress_message)
Called to run a JavaScript dialog.
|
boolean |
onKeyEvent(CefBrowser browser,
CefKeyboardHandler.CefKeyEvent event)
Called after the renderer and JavaScript in the page has had a chance to
handle the event.
|
void |
onLoadEnd(CefBrowser browser,
CefFrame frame,
int httpStatusCode)
Called when the browser is done loading a frame.
|
void |
onLoadError(CefBrowser browser,
CefFrame frame,
CefLoadHandler.ErrorCode errorCode,
java.lang.String errorText,
java.lang.String failedUrl)
Called when the resource load for a navigation fails or is canceled.
|
void |
onLoadingStateChange(CefBrowser browser,
boolean isLoading,
boolean canGoBack,
boolean canGoForward)
Called when the loading state has changed.
|
void |
onLoadStart(CefBrowser browser,
CefFrame frame,
CefRequest.TransitionType transitionType)
Called when the browser begins loading a frame.
|
void |
onMouseEvent(CefBrowser browser,
int event,
int screenX,
int screenY,
int modifier,
int button)
Implement this method to handle mouse events on Windows.
|
boolean |
onOpenURLFromTab(CefBrowser browser,
CefFrame frame,
java.lang.String target_url,
boolean user_gesture)
Called on the UI thread before OnBeforeBrowse in certain limited cases
where navigating a new or different browser might be desirable.
|
void |
onPaint(CefBrowser browser,
boolean popup,
java.awt.Rectangle[] dirtyRects,
java.nio.ByteBuffer buffer,
int width,
int height)
Handle painting.
|
void |
onPopupShow(CefBrowser browser,
boolean show)
Show or hide the popup window.
|
void |
onPopupSize(CefBrowser browser,
java.awt.Rectangle size)
Size the popup window.
|
boolean |
onPreKeyEvent(CefBrowser browser,
CefKeyboardHandler.CefKeyEvent event,
BoolRef is_keyboard_shortcut)
Called before a keyboard event is sent to the renderer.
|
boolean |
onPrintDialog(CefBrowser browser,
boolean hasSelection,
CefPrintDialogCallback callback)
Called to show the print dialog.
|
boolean |
onPrintJob(CefBrowser browser,
java.lang.String documentName,
java.lang.String pdfFilePath,
CefPrintJobCallback callback)
Called to send the print job to the printer.
|
void |
onPrintReset(CefBrowser browser)
Called to reset client state related to printing.
|
void |
onPrintSettings(CefBrowser browser,
CefPrintSettings settings,
boolean getDefaults)
Called to get print settings.
|
void |
onPrintStart(CefBrowser browser)
Called when printing has started.
|
void |
onRenderProcessTerminated(CefBrowser browser,
CefRequestHandler.TerminationStatus status,
int error_code,
java.lang.String error_string)
Called on the browser process UI thread when the render process terminates unexpectedly.
|
void |
onResetDialogState(CefBrowser browser)
Called to cancel any pending dialogs and reset any saved dialog state.
|
boolean |
onSetFocus(CefBrowser browser,
CefFocusHandler.FocusSource source)
Called when the browser component is requesting focus.
|
void |
onStatusMessage(CefBrowser browser,
java.lang.String value)
Received a status message.
|
void |
onTakeFocus(CefBrowser browser,
boolean next)
Called when the browser component is about to loose focus.
|
void |
onTitleChange(CefBrowser browser,
java.lang.String title)
Browser title changed.
|
boolean |
onTooltip(CefBrowser browser,
java.lang.String text)
About to display a tooltip.
|
void |
removeContextMenuHandler() |
void |
removeDialogHandler() |
void |
removeDisplayHandler() |
void |
removeDownloadHandler() |
void |
removeDragHandler() |
void |
removeFocusHandler() |
void |
removeJSDialogHandler() |
void |
removeKeyboardHandler() |
void |
removeLifeSpanHandler() |
void |
removeLoadHandler() |
void |
removeMessageRouter(CefMessageRouter messageRouter) |
void |
removeOnPaintListener(java.util.function.Consumer<CefPaintEvent> listener)
Remove provided listener.
|
void |
removePrintHandler() |
void |
removeRequestHandler() |
void |
setOnPaintListener(java.util.function.Consumer<CefPaintEvent> listener)
Remove existing listeners and replace with provided listener.
|
boolean |
startDragging(CefBrowser browser,
CefDragData dragData,
int mask,
int x,
int y)
Called when the user starts dragging content in the web view.
|
void |
updateDragCursor(CefBrowser browser,
int operation)
Called when the web view wants to update the mouse cursor during a
drag & drop operation.
|
getNativeRef, removeContextMenuHandler, removeDialogHandler, removeDisplayHandler, removeDownloadHandler, removeDragHandler, removeFocusHandler, removeJSDialogHandler, removeKeyboardHandler, removeLifeSpanHandler, removeLoadHandler, removePrintHandler, removeRenderHandler, removeRequestHandler, removeWindowHandler, setNativeRefclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNativeRef, setNativeRefpublic CefClient addContextMenuHandler(CefContextMenuHandler handler)
public CefClient addDialogHandler(CefDialogHandler handler)
public CefClient addDisplayHandler(CefDisplayHandler handler)
public CefClient addDownloadHandler(CefDownloadHandler handler)
public CefClient addDragHandler(CefDragHandler handler)
public CefClient addFocusHandler(CefFocusHandler handler)
public CefClient addJSDialogHandler(CefJSDialogHandler handler)
public CefClient addKeyboardHandler(CefKeyboardHandler handler)
public CefClient addLifeSpanHandler(CefLifeSpanHandler handler)
public CefClient addLoadHandler(CefLoadHandler handler)
public void addMessageRouter(CefMessageRouter messageRouter)
addMessageRouter in class CefClientHandlerpublic void addOnPaintListener(java.util.function.Consumer<CefPaintEvent> listener)
CefRenderHandleraddOnPaintListener in interface CefRenderHandlerlistener - Code that gets executed after a frame was rendered.public CefClient addPrintHandler(CefPrintHandler handler)
public CefClient addRequestHandler(CefRequestHandler handler)
public CefBrowser createBrowser(java.lang.String url, boolean isOffscreenRendered, boolean isTransparent)
public CefBrowser createBrowser(java.lang.String url, boolean isOffscreenRendered, boolean isTransparent, CefRequestContext context)
public CefBrowser createBrowser(java.lang.String url, boolean isOffscreenRendered, boolean isTransparent, CefRequestContext context, CefBrowserSettings settings)
public void dispose()
dispose in class CefClientHandlerpublic boolean doClose(CefBrowser browser)
CefLifeSpanHandlerdoClose in interface CefLifeSpanHandlerbrowser - The browser generating the event.protected java.lang.Object[] getAllBrowser()
CefClientHandlergetAllBrowser in class CefClientHandlerpublic boolean getAuthCredentials(CefBrowser browser, java.lang.String origin_url, boolean isProxy, java.lang.String host, int port, java.lang.String realm, java.lang.String scheme, CefAuthCallback callback)
CefRequestHandlergetAuthCredentials in interface CefRequestHandlerbrowser - The corresponding browser.origin_url - The origin making this authentication request.isProxy - True if the host is a proxy server.host - Hostname.port - Port number.realm - Realm of the request.scheme - Scheme of the request.callback - Call CefAuthCallback.Continue() when the authentication information is
available.protected CefBrowser getBrowser(int identifier)
CefClientHandlergetBrowser in class CefClientHandlerprotected CefContextMenuHandler getContextMenuHandler()
CefClientHandlergetContextMenuHandler in class CefClientHandlerprotected CefDialogHandler getDialogHandler()
CefClientHandlergetDialogHandler in class CefClientHandlerprotected CefDisplayHandler getDisplayHandler()
CefClientHandlergetDisplayHandler in class CefClientHandlerprotected CefDownloadHandler getDownloadHandler()
CefClientHandlergetDownloadHandler in class CefClientHandlerprotected CefDragHandler getDragHandler()
CefClientHandlergetDragHandler in class CefClientHandlerprotected CefFocusHandler getFocusHandler()
CefClientHandlergetFocusHandler in class CefClientHandlerprotected CefJSDialogHandler getJSDialogHandler()
CefClientHandlergetJSDialogHandler in class CefClientHandlerprotected CefKeyboardHandler getKeyboardHandler()
CefClientHandlergetKeyboardHandler in class CefClientHandlerprotected CefLifeSpanHandler getLifeSpanHandler()
CefClientHandlergetLifeSpanHandler in class CefClientHandlerprotected CefLoadHandler getLoadHandler()
CefClientHandlergetLoadHandler in class CefClientHandlerpublic java.awt.Dimension getPdfPaperSize(CefBrowser browser, int deviceUnitsPerInch)
CefPrintHandlergetPdfPaperSize in interface CefPrintHandlerbrowser - The corresponding browser.deviceUnitsPerInch - The DPI of the print. Use this to calculate the page size to use.protected CefPrintHandler getPrintHandler()
CefClientHandlergetPrintHandler in class CefClientHandlerpublic java.awt.Rectangle getRect(CefBrowser browser)
CefWindowHandlergetRect in interface CefWindowHandlerbrowser - The browser generating the event.protected CefRenderHandler getRenderHandler()
CefClientHandlergetRenderHandler in class CefClientHandlerprotected CefRequestHandler getRequestHandler()
CefClientHandlergetRequestHandler in class CefClientHandlerpublic CefResourceRequestHandler getResourceRequestHandler(CefBrowser browser, CefFrame frame, CefRequest request, boolean isNavigation, boolean isDownload, java.lang.String requestInitiator, BoolRef disableDefaultHandling)
CefRequestHandlergetResourceRequestHandler in interface CefRequestHandlerbrowser - The corresponding browser.frame - The frame generating the event. Instance only valid within the scope of this
method.request - The request itself. Cannot be modified in this callback. Instance only valid
within the scope of this method.isNavigation - True if the resource request is a navigation.isDownload - True if the resource request is a download.requestInitiator - The origin (scheme + domain) of the page that initiated the request.disableDefaultHandling - Set to true to disable default handling of the request, in
which case it will need to be handled via
CefResourceRequestHandler.getResourceHandler or it will be canceled.public boolean getScreenInfo(CefBrowser arg0, CefScreenInfo arg1)
CefRenderHandlergetScreenInfo in interface CefRenderHandlerarg0 - The browser generating the event.arg1 - The screenInfopublic java.awt.Point getScreenPoint(CefBrowser browser, java.awt.Point viewPoint)
CefRenderHandlergetScreenPoint in interface CefRenderHandlerbrowser - The browser generating the event.viewPoint - The point in the view.public java.awt.Rectangle getViewRect(CefBrowser browser)
CefRenderHandlergetViewRect in interface CefRenderHandlerbrowser - The browser generating the event.protected CefWindowHandler getWindowHandler()
CefClientHandlergetWindowHandler in class CefClientHandlerpublic void onAddressChange(CefBrowser browser, CefFrame frame, java.lang.String url)
CefDisplayHandleronAddressChange in interface CefDisplayHandlerbrowser - The browser generating the event.frame - The frame generating the event.url - The new address.public void onAfterCreated(CefBrowser browser)
CefLifeSpanHandleronAfterCreated in interface CefLifeSpanHandlerbrowser - The browser generating the event.public void onAfterParentChanged(CefBrowser browser)
CefLifeSpanHandleronAfterParentChanged in interface CefLifeSpanHandlerbrowser - The browser generating the event.public boolean onBeforeBrowse(CefBrowser browser, CefFrame frame, CefRequest request, boolean user_gesture, boolean is_redirect)
CefRequestHandleronBeforeBrowse in interface CefRequestHandlerbrowser - The corresponding browser.frame - The frame generating the event. Instance only valid within the scope of this
method.request - The request itself. Cannot be modified in this callback. Instance only valid
within the scope of this method.user_gesture - True if the request was initiated by a user gesture.is_redirect - True if the request was redirected.public void onBeforeClose(CefBrowser browser)
CefLifeSpanHandleronBeforeClose in interface CefLifeSpanHandlerbrowser - The browser generating the event.public void onBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams params, CefMenuModel model)
CefContextMenuHandleronBeforeContextMenu in interface CefContextMenuHandlerbrowser - The browser generating the event.frame - The frame generating the event. Instance only valid within the scope
of this method.params - Provides information about the context menu state. Instance
only valid within the scope of this method.model - Can be cleared to show no context menu or modified
to show a custom menu. Instance only valid within the scope of this
method.public boolean onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem, java.lang.String suggestedName, CefBeforeDownloadCallback callback)
CefDownloadHandleronBeforeDownload in interface CefDownloadHandlerbrowser - The desired browser.downloadItem - The item to be downloaded. Do not keep a reference to it outside this
method.suggestedName - is the suggested name for the download file.callback - start the download by calling the Continue methodpublic boolean onBeforePopup(CefBrowser browser, CefFrame frame, java.lang.String target_url, java.lang.String target_frame_name)
CefLifeSpanHandleronBeforePopup in interface CefLifeSpanHandlerbrowser - The source of the popup request.frame - The source of the popup request. Instance only valid within the scope of this
method.target_url - May be empty if none is specified with the request.target_frame_name - May be empty if none is specified with the request.public boolean onBeforeUnloadDialog(CefBrowser browser, java.lang.String message_text, boolean is_reload, CefJSDialogCallback callback)
CefJSDialogHandleronBeforeUnloadDialog in interface CefJSDialogHandlerbrowser - The corresponding browser.message_text - The text to be displayed.is_reload - true if the page is reloaded.callback - execute callback once the custom dialog is dismissed.public boolean onCertificateError(CefBrowser browser, CefLoadHandler.ErrorCode cert_error, java.lang.String request_url, CefCallback callback)
CefRequestHandleronCertificateError in interface CefRequestHandlerbrowser - The corresponding browser.cert_error - Error code describing the error.request_url - The requesting URL.callback - Call CefCallback.Continue() either in this method or at a later time
to continue or cancel the request. If null the error cannot be recovered from and the
request will be canceled automatically.public boolean onConsoleMessage(CefBrowser browser, CefSettings.LogSeverity level, java.lang.String message, java.lang.String source, int line)
CefDisplayHandleronConsoleMessage in interface CefDisplayHandlerbrowser - The browser generating the event.public boolean onContextMenuCommand(CefBrowser browser, CefFrame frame, CefContextMenuParams params, int commandId, int eventFlags)
CefContextMenuHandleronContextMenuCommand in interface CefContextMenuHandlerbrowser - The browser generating the event.frame - The frame generating the event. Instance only valid within the scope
of this method.params - Will have the same values that were passed to onBeforeContextMenu().
Instance only valid within the scope of this method.commandId - The id of the command.eventFlags - A combination of event flags defined in EventFlagspublic void onContextMenuDismissed(CefBrowser browser, CefFrame frame)
CefContextMenuHandleronContextMenuDismissed in interface CefContextMenuHandlerbrowser - The browser generating the event.frame - The corresponding frame. Instance only valid within the scope
of this method.public boolean onCursorChange(CefBrowser browser, int cursorType)
CefDisplayHandleronCursorChange in interface CefDisplayHandleronCursorChange in interface CefRenderHandlerbrowser - The browser generating the event.cursorType - The new cursor type.public void onDialogClosed(CefBrowser browser)
CefJSDialogHandleronDialogClosed in interface CefJSDialogHandlerpublic void onDownloadUpdated(CefBrowser browser, CefDownloadItem downloadItem, CefDownloadItemCallback callback)
CefDownloadHandleronDownloadUpdated in interface CefDownloadHandlerbrowser - The desired browser.downloadItem - The downloading item.callback - Execute callback to cancel the downloadpublic boolean onDragEnter(CefBrowser browser, CefDragData dragData, int mask)
CefDragHandleronDragEnter in interface CefDragHandlerbrowser - The browser generating the event.dragData - Contains the drag event data. Instance only valid within the scope
of this method.mask - Represents the type of drag operation. See DragOperationMask for possible values.public boolean onFileDialog(CefBrowser browser, CefDialogHandler.FileDialogMode mode, java.lang.String title, java.lang.String defaultFilePath, java.util.Vector<java.lang.String> acceptFilters, java.util.Vector<java.lang.String> acceptExtensions, java.util.Vector<java.lang.String> acceptDescriptions, CefFileDialogCallback callback)
CefDialogHandleronFileDialog in interface CefDialogHandlermode - 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").acceptExtensions - provides the semicolon-delimited expansion of MIME
types to file extensions (if known, or empty string otherwise).acceptDescriptions - provides the descriptions for MIME types (if known,
or empty string otherwise). For example, the "image/*" mime type might
have extensions ".png;.jpg;.bmp;..." and description "Image Files".callback - is a callback handler for handling own file dialogs.public void onFullscreenModeChange(CefBrowser browser, boolean fullscreen)
CefDisplayHandleronFullscreenModeChange in interface CefDisplayHandlerbrowser - The browser generating the event.fullscreen - True if fullscreen mode is on.public void onGotFocus(CefBrowser browser)
CefFocusHandleronGotFocus in interface CefFocusHandlerbrowser - The browser generating the event.public boolean onJSDialog(CefBrowser browser, java.lang.String origin_url, CefJSDialogHandler.JSDialogType dialog_type, java.lang.String message_text, java.lang.String default_prompt_text, CefJSDialogCallback callback, BoolRef suppress_message)
CefJSDialogHandleronJSDialog in interface CefJSDialogHandlerbrowser - The corresponding browser.origin_url - The originating url.dialog_type - the dialog type.message_text - the text to be displayed.default_prompt_text - value will be specified for prompt dialogs only.callback - execute callback once the custom dialog is dismissed.suppress_message - set to true to suppress displaying the message.public boolean onKeyEvent(CefBrowser browser, CefKeyboardHandler.CefKeyEvent event)
CefKeyboardHandleronKeyEvent in interface CefKeyboardHandlerbrowser - the corresponding browser.event - contains information about the keyboard event.public void onLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode)
CefLoadHandleronLoadEnd in interface CefLoadHandlerbrowser - The corresponding browser.frame - The frame generating the event. Instance only valid within the scope of this
method.httpStatusCode - The status code of the load.public void onLoadError(CefBrowser browser, CefFrame frame, CefLoadHandler.ErrorCode errorCode, java.lang.String errorText, java.lang.String failedUrl)
CefLoadHandleronLoadError in interface CefLoadHandlerbrowser - The corresponding browser.frame - The frame generating the event. Instance only valid within the scope of this
method.errorCode - The error code number.errorText - The error text.failedUrl - The URL that failed to load.public void onLoadingStateChange(CefBrowser browser, boolean isLoading, boolean canGoBack, boolean canGoForward)
CefLoadHandleronLoadingStateChange in interface CefLoadHandlerbrowser - The corresponding browser.isLoading - true if it is loading.canGoBack - true if you can navigate back.canGoForward - true if you can navigate forward.public void onLoadStart(CefBrowser browser, CefFrame frame, CefRequest.TransitionType transitionType)
CefLoadHandleronLoadStart in interface CefLoadHandlerbrowser - The corresponding browser.frame - The frame generating the event. Instance only valid within the scope of this
method.transitionType - The transition type.public void onMouseEvent(CefBrowser browser, int event, int screenX, int screenY, int modifier, int button)
CefWindowHandleronMouseEvent in interface CefWindowHandlerbrowser - The browser generating the event.event - A mouse event like MouseEvent.MOUSE_MOVED.screenX - The absolute X position on the screen.screenY - The absolute Y position on the screen.modifier - The modifier keys down during event (e.g. Shift, Ctrl).button - An integer indicating which mouse button state changed.
If parameter event is set to MouseEvent.MOUSE_WHEEL, the value of this
parameter specifies the rotation indicator (negative value for left scroll
and positive value for right scroll).public boolean onOpenURLFromTab(CefBrowser browser, CefFrame frame, java.lang.String target_url, boolean user_gesture)
CefRequestHandleronOpenURLFromTab in interface CefRequestHandlerbrowser - The corresponding browser.frame - The frame generating the event. Instance only valid within the scope of this
methoduser_gesture - True if the request was initiated by a user gesture.public void onPaint(CefBrowser browser, boolean popup, java.awt.Rectangle[] dirtyRects, java.nio.ByteBuffer buffer, int width, int height)
CefRenderHandleronPaint in interface CefRenderHandlerbrowser - The browser generating the event.popup - True if painting a popup window.dirtyRects - Array of dirty regions.buffer - Pixel buffer for the whole window.width - Width of the buffer.height - Height of the buffer.public void onPopupShow(CefBrowser browser, boolean show)
CefRenderHandleronPopupShow in interface CefRenderHandlerbrowser - The browser generating the event.show - True if the popup window is being shown.public void onPopupSize(CefBrowser browser, java.awt.Rectangle size)
CefRenderHandleronPopupSize in interface CefRenderHandlerbrowser - The browser generating the event.size - Size of the popup window.public boolean onPreKeyEvent(CefBrowser browser, CefKeyboardHandler.CefKeyEvent event, BoolRef is_keyboard_shortcut)
CefKeyboardHandleronPreKeyEvent in interface CefKeyboardHandlerbrowser - the corresponding browser.event - contains information about the keyboard event.is_keyboard_shortcut - set to true and return false, if
the event will be handled in OnKeyEvent() as a keyboard shortcut.public boolean onPrintDialog(CefBrowser browser, boolean hasSelection, CefPrintDialogCallback callback)
CefPrintHandleronPrintDialog in interface CefPrintHandlerbrowser - The corresponding browser.hasSelection - True if the user has selected a region of the page to print.callback - Callback to execute after the dialog is dismissed.public boolean onPrintJob(CefBrowser browser, java.lang.String documentName, java.lang.String pdfFilePath, CefPrintJobCallback callback)
CefPrintHandleronPrintJob in interface CefPrintHandlerbrowser - The corresponding browser.documentName - Name of the document that is printing.pdfFilePath - Path to the PDF file that contains the document contents.callback - Callback to execute after the print job has completed.public void onPrintReset(CefBrowser browser)
CefPrintHandleronPrintReset in interface CefPrintHandlerbrowser - The corresponding browser.public void onPrintSettings(CefBrowser browser, CefPrintSettings settings, boolean getDefaults)
CefPrintHandleronPrintSettings in interface CefPrintHandlerbrowser - The corresponding browser.settings - Populate with the desired print settings. Do not keep a reference to this
object outside of this callback.getDefaults - If true |settings| should be populated with the default print settings.public void onPrintStart(CefBrowser browser)
CefPrintHandleronPrintStart in interface CefPrintHandlerbrowser - The corresponding browser.public void onRenderProcessTerminated(CefBrowser browser, CefRequestHandler.TerminationStatus status, int error_code, java.lang.String error_string)
CefRequestHandleronRenderProcessTerminated in interface CefRequestHandlerbrowser - The corresponding browser.status - Indicates how the process was terminated.error_code - The process error code.error_string - A string description of the error.public void onResetDialogState(CefBrowser browser)
CefJSDialogHandleronResetDialogState in interface CefJSDialogHandlerpublic boolean onSetFocus(CefBrowser browser, CefFocusHandler.FocusSource source)
CefFocusHandleronSetFocus in interface CefFocusHandlerbrowser - The browser generating the event.source - indicates/ where the focus request is originating from.public void onStatusMessage(CefBrowser browser, java.lang.String value)
CefDisplayHandleronStatusMessage in interface CefDisplayHandlerbrowser - The browser generating the event.value - Contains the text that will be displayed in the status message.public void onTakeFocus(CefBrowser browser, boolean next)
CefFocusHandleronTakeFocus in interface CefFocusHandlerbrowser - The browser generating the event.next - will be true if the browser is giving focus to the
next component and false if the browser is giving focus
to the previous component.public void onTitleChange(CefBrowser browser, java.lang.String title)
CefDisplayHandleronTitleChange in interface CefDisplayHandlerbrowser - The browser generating the event.title - The new title.public boolean onTooltip(CefBrowser browser, java.lang.String text)
CefDisplayHandleronTooltip in interface CefDisplayHandlerbrowser - The browser generating the event.text - Contains the text that will be displayed in the tooltip.public void removeContextMenuHandler()
public void removeDialogHandler()
public void removeDisplayHandler()
public void removeDownloadHandler()
public void removeDragHandler()
public void removeFocusHandler()
public void removeJSDialogHandler()
public void removeKeyboardHandler()
public void removeLifeSpanHandler()
public void removeLoadHandler()
public void removeMessageRouter(CefMessageRouter messageRouter)
removeMessageRouter in class CefClientHandlerpublic void removeOnPaintListener(java.util.function.Consumer<CefPaintEvent> listener)
CefRenderHandlerremoveOnPaintListener in interface CefRenderHandlerlistener - Code that gets executed after a frame was rendered.public void removePrintHandler()
public void removeRequestHandler()
public void setOnPaintListener(java.util.function.Consumer<CefPaintEvent> listener)
CefRenderHandlersetOnPaintListener in interface CefRenderHandlerlistener - Code that gets executed after a frame was rendered.public boolean startDragging(CefBrowser browser, CefDragData dragData, int mask, int x, int y)
CefRenderHandlerstartDragging in interface CefRenderHandlerbrowser - The browser generating the event.dragData - Contextual information about the dragged contentmask - Describes the allowed operation (none, move, copy, link).x - Coordinate within CefBrowsery - Coordinate within CefBrowserpublic void updateDragCursor(CefBrowser browser, int operation)
CefRenderHandlerupdateDragCursor in interface CefRenderHandlerbrowser - The browser generating the event.operation - Describes the allowed operation (none, move, copy, link).