Deduping Notifications


I have a notification that pops up when one of 2 files is changed. If both files are changed, 2 notifications will be displayed and each of the notifications prompts the user to perform the same action. I was wondering if it was possible to group and configure the notifications such that

* If one of the notifications is already showing, don't show the other one.

* If the above is not possible, remove both of the notifications when the user performs the action on one of the notifications.

1 comment
Comment actions Permalink

Extend from Notification in custom inheritor, then you can check present ones via com.intellij.notification.NotificationsManager#getNotificationsOfType and use com.intellij.notification.NotificationsManager#expire to hide them if needed. See com.intellij.openapi.project.impl.UnableToSaveProjectNotification in IJ Community sources for sample.


Please sign in to leave a comment.