This commit is contained in:
peter
2011-06-08 15:03:19 +02:00
parent 67b540de95
commit 8ddd290807
2 changed files with 8 additions and 9 deletions
@@ -46,7 +46,7 @@ import java.util.List;
* @author spleaner
*/
public class NotificationsManagerImpl extends NotificationsManager implements Notifications, ApplicationComponent {
public static final String LOG_TOOL_WINDOW_ID = "Event Log";
private static final String LOG_TOOL_WINDOW_ID = "Event Log";
private final NotificationModel myModel = new NotificationModel();
@@ -246,14 +246,15 @@ public class NotificationsManagerImpl extends NotificationsManager implements No
}
public static boolean isEventLogVisible(Project project) {
if (project == null) {
return false;
}
final ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(LOG_TOOL_WINDOW_ID);
final ToolWindow window = getEventLog(project);
return window != null && window.isVisible();
}
@Nullable
public static ToolWindow getEventLog(Project project) {
return project == null ? null : ToolWindowManager.getInstance(project).getToolWindow(LOG_TOOL_WINDOW_ID);
}
private static PairFunction<Notification, Project, Boolean> createFilter(@Nullable final Project project, final boolean strict) {
return project == null ? APPLICATION : new ProjectFilter(project, strict);
}
@@ -26,7 +26,6 @@ import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.util.Alarm;
import com.intellij.util.text.DateFormatUtil;
@@ -93,8 +92,7 @@ class StatusPanel extends JPanel {
@Nullable
private ToolWindow getEventLog() {
final Project project = getActiveProject();
return project != null ? ToolWindowManager.getInstance(project).getToolWindow(NotificationsManagerImpl.LOG_TOOL_WINDOW_ID) : null;
return NotificationsManagerImpl.getEventLog(getActiveProject());
}
public void setLogMessage(String text) {