Constructor and Description |
---|
JNICef() |
Modifier and Type | Method and Description |
---|---|
Browser |
createBrowser(RenderHandler renderHandler,
java.net.URL initialURL)
Create a new browser.
|
void |
doMessageLoopWork()
Perform a single iteration of CEF message loop processing.
|
protected void |
ensureInitialized() |
void |
initialize()
Initialize CEF.
|
boolean |
isInitialized() |
void |
shutdown()
Shutdown CEF processes, should be called before the application exits.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
start()
Start CEF and run the automatic message loop.
|
public void initialize()
Cef
Cef.doMessageLoopWork()
.
Must be called from the main application thread (see CEF documentation on CefInitialize
).initialize
in interface Cef
public java.util.concurrent.CompletableFuture<java.lang.Void> start()
Cef
CefRunMessageLoop
). When using this method,
Cef.initialize()
must not be invoked manually as it will be handled by the
implementation to ensure it happens on the correct thread.start
in interface Cef
CompletableFuture
which completes when CEF has been initialized.
Can be used to determine the status as alternative to polling Cef.isInitialized()
.public void doMessageLoopWork()
Cef
Cef.initialize()
beforehand. Must be called from the main application thread
(see CEF documentation on CefDoMessageLoopWork
).
Note that care needs to be taken to neither call this too infrequently (to avoid starving the CEF message loop)
but also not too often (to avoid impacting CPU usage) - see CEF documentation for details when using this approach.doMessageLoopWork
in interface Cef
public void shutdown() throws java.lang.InterruptedException
Cef
Cef.doMessageLoopWork()
, this must be called from the main
application thread (see CEF documentation on CefShutdown
). When using the integrated/automatic
message loop it may be invoked from any thread as the implementation ensures the shutdown is run on the correct thread.public boolean isInitialized()
isInitialized
in interface Cef
protected void ensureInitialized()
public Browser createBrowser(RenderHandler renderHandler, java.net.URL initialURL)
Cef
createBrowser
in interface Cef
renderHandler
- handler which provides viewport information and renders imagesinitialURL
- the initial URL to load in the created browser