mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
on project closing, clear the status bar log message
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user