NewErrorTreeViewPanel (final @NotNull ProjectSystemId externalSystemId, final @NotNull NotificationSource notificationSource, boolean activateView) { ThreadingAssertions.assertEventDispatchThread(); final NewErrorTreeViewPanel errorTreeView; final String contentDisplayName = getContentDisplayName(notificationSource, externalSystemId); final Pair<NotificationSource, ProjectSystemId> contentIdPair = Pair.create(notificationSource, externalSystemId); Content targetContent = findContent(contentIdPair, contentDisplayName); assert myProject != null; final MessageView messageView = MessageView.getInstance(myProject); if (targetContent == null || !contentIdPair.equals(targetContent.getUserData(CONTENT_ID_KEY))) { errorTreeView = new NewEditableErrorTreeViewPanel(myProject, null, true, true, null); targetContent = ContentFactory.getInstance().createContent(errorTreeView, contentDisplayName, true); targetContent.putUserData(CONTENT_ID_KEY, contentIdPair); messageView.getContentManager().addContent(targetContent); Disposer.register(targetContent, errorTreeView); } else { assert targetContent.getComponent() instanceof NewEditableErrorTreeViewPanel; errorTreeView = (NewEditableErrorTreeViewPanel)targetContent.getComponent(); } messageView.getContentManager().setSelectedContent(targetContent); final ToolWindow tw = ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.MESSAGES_WINDOW); if (activateView && tw != null && !tw.isActive()) { tw.activate(null, false); } return errorTreeView; }