void () { CommandProcessor commandProcessor = CommandProcessor.getInstance(); commandProcessor.executeCommand(myProject, () -> { MessageView messageView = MessageView.getInstance(myProject); Content content = ContentFactory.getInstance().createContent(myErrorsView.getComponent(), myContentName, true); content.putUserData(myKey, myErrorsView); messageView.getContentManager().addContent(content); messageView.getContentManager().setSelectedContent(content); messageView.getContentManager().addContentManagerListener(new CloseListener(content, myContentName, myErrorsView)); ContentManagerUtil.cleanupContents(content, myProject, myContentName); messageView.getContentManager().addContentManagerListener(new MyContentDisposer(content, messageView, myKey)); }, ExecutionBundle.message("open.message.view"), null); ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.MESSAGES_WINDOW).activate(null); }