on project closing, clear the status bar log message

This commit is contained in:
peter
2011-06-01 18:19:14 +02:00
parent e27aec1d6a
commit e3ec4d4bca
3 changed files with 19 additions and 1 deletions
@@ -120,6 +120,10 @@ public class EventLog implements Notifications {
}
view.print("\n", ConsoleViewContentType.NORMAL_OUTPUT);
notifyStatusBar(project, mainText);
}
private static void notifyStatusBar(Project project, @Nullable String mainText) {
final IdeFrame frame = WindowManager.getInstance().getIdeFrame(project);
if (frame != null) {
final StatusBar statusBar = frame.getStatusBar();
@@ -172,6 +176,11 @@ public class EventLog implements Notifications {
}
myGlobalNotifications.clear();
}
@Override
public void projectClosed() {
notifyStatusBar(myProject, null);
}
}
public static ProjectTracker getProjectComponent(Project project) {
@@ -54,5 +54,5 @@ public interface StatusBarEx extends StatusBar, Disposable {
@Nullable
String getInfoRequestor();
void setLogMessage(String text);
void setLogMessage(@Nullable String text);
}
@@ -16,6 +16,7 @@
package com.intellij.openapi.wm.impl.status;
import com.intellij.notification.impl.NotificationsManagerImpl;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
@@ -88,12 +89,20 @@ class StatusPanel extends JPanel {
}
public void setLogMessage(String text) {
ApplicationManager.getApplication().assertIsDispatchThread();
myLogMessage = text;
myLogTime = new Date();
myDirty = false;
if (text == null) {
updateText(false, "");
}
}
public boolean updateText(boolean logAllowed, @Nullable String nonLogText) {
ApplicationManager.getApplication().assertIsDispatchThread();
myLogMode = logAllowed && StringUtil.isEmpty(nonLogText) && myLogMessage != null;
myShowLog.setVisible(myLogMode);