JBCefClient (@NotNull CefDisplayHandler handler, @NotNull CefBrowser browser) { return myDisplayHandler.add(handler, browser, () -> { myCefClient.addDisplayHandler(new CefDisplayHandler() { @Override public void onAddressChange(CefBrowser browser, CefFrame frame, String url) { myDisplayHandler.handle(browser, handler -> { handler.onAddressChange(browser, frame, url); }); } @Override public void onTitleChange(CefBrowser browser, String title) { myDisplayHandler.handle(browser, handler -> { handler.onTitleChange(browser, title); }); } @Override public boolean onTooltip(CefBrowser browser, String text) { return myDisplayHandler.handleBoolean(browser, handler -> { return handler.onTooltip(browser, text); }); } @Override public void onStatusMessage(CefBrowser browser, String value) { myDisplayHandler.handle(browser, handler -> { handler.onStatusMessage(browser, value); }); } @Override public boolean onConsoleMessage(CefBrowser browser, CefSettings.LogSeverity level, String message, String source, int line) { return myDisplayHandler.handleBoolean(browser, handler -> { return handler.onConsoleMessage(browser, level, message, source, line); }); } @Override public boolean onCursorChange(CefBrowser browser, int cursorType) { return myDisplayHandler.handleBoolean(browser, handler -> { return handler.onCursorChange(browser, cursorType); }); } }); }); }