Hello!
In this post, I would like to show how to create a simple plugin for IntelliJ with JCEF, the new WebView framework. In our company, we use it to build such tools as GraphBuddy or CodeTale. The first one is already released, the second one we are still working on in our R&D team. It is a plugin to your IDE, which enables you to browse comments from pull requests.
To make the UI easier to reuse with many IDEs, we have decided to use WebView. If you are not familiar with it — it’s an embedded web browser, which allows you to create a UI once in the form of a web page. From the beginning of the project, we have decided to support two IDEs: IntelliJ and VSCode, as one of the most popular IDEs. VSCode bases on WebView technology — Electron, so it uses an efficient Chromium web engine.
On the opposite, IntelliJ supported only the obsolete JavaFX version of WebView up to the middle of this year. It uses an old Safari engine, which generates some problems with the UI (mainly poor performance). However, in version 2020.2 there was introduced a new officially supported implementation of WebView — JCEF. The community requested this change for a long time, and finally, there it is! It uses Chromium, so it is much faster and easier to debug. What’s more, the old one is no longer officially supported.
Maybe in the next blog post, I could present an example of migration — please, let me know if you are interested :) But now, I would like to show you how to build a toy plugin for IntelliJ. It would render a web page saved in plugin’s resources folder — what is a bit tricky part since JCEF doesn’t support jar protocol.
What do you need?
- installed
JDK - installed or downloaded
Gradle - your favourite IDE
- 10 minutes
- a cup of
coffeeor mug of tea ;)
So, let’s start!
At first, we need to create plugin.xml file:





