mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Platform: whenExpired callback for Notification
+review CR-IC @gromopetr
This commit is contained in:
@@ -38,6 +38,7 @@ public class Notification {
|
||||
private final NotificationListener myListener;
|
||||
private final String myTitle;
|
||||
private boolean myExpired;
|
||||
private Runnable myWhenExpired;
|
||||
private Boolean myImportant;
|
||||
private WeakReference<Balloon> myBalloonRef;
|
||||
|
||||
@@ -102,6 +103,14 @@ public class Notification {
|
||||
NotificationsManager.getNotificationsManager().expire(this);
|
||||
hideBalloon();
|
||||
myExpired = true;
|
||||
|
||||
Runnable whenExpired = myWhenExpired;
|
||||
if (whenExpired != null) whenExpired.run();
|
||||
}
|
||||
|
||||
public Notification whenExpired(@Nullable Runnable whenExpired) {
|
||||
myWhenExpired = whenExpired;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void hideBalloon() {
|
||||
|
||||
Reference in New Issue
Block a user