IDEA-80382 Notifications: when balloon is shown in Event Log and after clicking...
authorpeter <peter@jetbrains.com>
Thu, 26 Jan 2012 12:44:51 +0000 (13:44 +0100)
committerpeter <peter@jetbrains.com>
Thu, 26 Jan 2012 12:45:54 +0000 (13:45 +0100)
platform/platform-api/src/com/intellij/notification/Notification.java
platform/platform-impl/src/com/intellij/notification/EventLog.java

index 91c23432ba70e06254e48fd337d4fe6e7a385c44..b264b20d1c3cab83f19f412bfe418af8b1358829 100644 (file)
@@ -97,6 +97,11 @@ public class Notification {
 
   public void expire() {
     NotificationsManager.getNotificationsManager().expire(this);
+    hideBalloon();
+    myExpired = true;
+  }
+
+  public void hideBalloon() {
     if (myBalloonRef != null) {
       final Balloon balloon = myBalloonRef.get();
       if (balloon != null) {
@@ -104,7 +109,6 @@ public class Notification {
       }
       myBalloonRef = null;
     }
-    myExpired = true;
   }
 
   public void setBalloon(@Nullable final Balloon balloon) {
index 2d1e660c2c6d189cf4587d5c2bf8bc4b7de7631b..79d6ad266beaaae817a1ede871c9658be5ff18ca 100644 (file)
@@ -415,6 +415,8 @@ public class EventLog implements Notifications {
         Balloon balloon = NotificationsManagerImpl.createBalloon(myNotification, true, true);
         Disposer.register(project, balloon);
         balloon.show(target, Balloon.Position.above);
+        myNotification.hideBalloon();
+        myNotification.setBalloon(balloon);
       }
     }