Search code examples
javakotlinintellij-ideaideintellij-plugin

Intellij DialogWrapper and Balloon notifications


I am writing an Intellij Plugin using Kotlin.

I have a class that extends DialogWrapper and that's where my GUI lives.

Problem: How do I show a Balloon notification while the DialogWrapper is still visible? if this is not possible, how should I show the Balloon notification as soon as the DialogWrapper is dismissed?

So I want to trigger a Balloon notification when this function is invoked:

override fun doOKAction() {
    // Show Balloon Notification
    super.doOKAction()
}

Currently, when I trigger Balloon Notification I see my notification only in the Event Log.

Appreciate your help.


Solution

  • I ended up using Timer and schedule:

    override fun doOKAction() {
        super.doOKAction()
        Timer("Show Balloon", false).schedule(500){
          // Show Balloon notification
        }
    }