JetBrains deprecated JavaFX in all newer IntelliJ versions, thereby also stopping support for the by us used JavaFX Browser WebView. As an alternative, they introduced a wrapper for the Chromium Embedded Framework, which serves an up-to-date and most importantly maintained browser.
The original wrapper for this in Java, JCEF, has been integrated into the JBR, resulting in the JBCef wrapper components. The documentation, as it is sadly often the case for the JetBrains plugin development, is very rudimentary. The most important parts are explained here: https://jetbrains.org/intellij/sdk/docs/reference_guide/jcef.html.
Everything else should be possible to use 1-to-1 as with the existing Java wrappers, only that we now have to use the JBCef wrapper components instead. So, if one were to have a look at the original CEF/JCEF documentation, it should be doable to migrate to the new framework and remove the current (unstable) workaround of relying on the JavaFX plugin.
As an example, a very basic browser can already be created with
class JcefBrowserWebView {
private lateinit var browser: JBCefBrowser
fun init() {
runInEdt {
browser = JBCefBrowser("https://www.google.com")
}
}
fun getBrowserComponent(): JComponent = browser.component
}
In order to fully integrate Artemis and especially the bridge between browser and native Kotlin/Java IDE components, one would have to have a look at how executing Javascript code (i.e. modifying the ArtemisClientConnector
class) and calling methods on Java components (i.e. modifying the OrionConnector
class and maybe all subclasses). Afaik, executing JS is possible in an asynchronous was, the bigger problem should be calling Java code from within the browser as this is not as easy as with the old WebView. Here, CefMessageRouter
might be one way to solve this problem, but further research is necessary.