Basic question for placing a plugin in the status bar


I'm just starting playing around with the plugin SDK for IntelliJ IDEA. However I already have some trouble with the first steps.

Here's what I'd like to do: As a very basic first step I'd like to place some kind of clickable item in the lower status bar, next to where the Git integration is located. When clicking that item it should just display some text as a popup.

But how can I place such a component there?



You can implement `com.intellij.openapi.wm.StatusBarWidget` and register it using 

StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null) statusBar.addWidget(widget, [Anchor], [disposable]);

For example, when project is opened - by registering `com.intellij.openapi.startup.StartupActivity` with 

<postStartupActivity implementation="com.MyInitWidgetActivity"/>

See as an example.


Thanks Aleksey, this is working fine :-)


This approach is now obsolete. I've been working on a status bar widget recently. As of Intellij 2020.1, you now need to add your own implementation of ServerStatusBarWidgetFactory and add it in plugin.xml

<statusBarWidgetFactory implementation="com.domain.MyServerStatusBarWidgetFactory" />

Then you create the StatusBarWidget from within the factory class


Please sign in to leave a comment.