use of com.intellij.ui.content.MessageView in project intellij-community by JetBrains.
the class ExecutionHelper method removeContents.
private static void removeContents(@Nullable final Content notToRemove, @NotNull final Project myProject, @NotNull final String tabDisplayName) {
MessageView messageView = ServiceManager.getService(myProject, MessageView.class);
Content[] contents = messageView.getContentManager().getContents();
for (Content content : contents) {
LOG.assertTrue(content != null);
if (content.isPinned())
continue;
if (tabDisplayName.equals(content.getDisplayName()) && content != notToRemove) {
ErrorTreeView listErrorView = (ErrorTreeView) content.getComponent();
if (listErrorView != null) {
if (messageView.getContentManager().removeContent(content, true)) {
content.release();
}
}
}
}
}
use of com.intellij.ui.content.MessageView in project intellij-community by JetBrains.
the class ExecutionHelper method openMessagesView.
private static void openMessagesView(@NotNull final ErrorViewPanel errorTreeView, @NotNull final Project myProject, @NotNull final String tabDisplayName) {
CommandProcessor commandProcessor = CommandProcessor.getInstance();
commandProcessor.executeCommand(myProject, () -> {
final MessageView messageView = ServiceManager.getService(myProject, MessageView.class);
final Content content = ContentFactory.SERVICE.getInstance().createContent(errorTreeView, tabDisplayName, true);
messageView.getContentManager().addContent(content);
Disposer.register(content, errorTreeView);
messageView.getContentManager().setSelectedContent(content);
removeContents(content, myProject, tabDisplayName);
}, "Open message view", null);
}
use of com.intellij.ui.content.MessageView in project intellij-community by JetBrains.
the class ExternalSystemNotificationManager method findContent.
@Nullable
private Content findContent(@NotNull Pair<NotificationSource, ProjectSystemId> contentIdPair, @NotNull String contentDisplayName) {
Content targetContent = null;
final MessageView messageView = ServiceManager.getService(myProject, MessageView.class);
for (Content content : messageView.getContentManager().getContents()) {
if (contentIdPair.equals(content.getUserData(CONTENT_ID_KEY)) && StringUtil.equals(content.getDisplayName(), contentDisplayName) && !content.isPinned()) {
targetContent = content;
}
}
return targetContent;
}
use of com.intellij.ui.content.MessageView in project intellij-community by JetBrains.
the class NewErrorTreeViewPanel method close.
public void close() {
MessageView messageView = MessageView.SERVICE.getInstance(myProject);
Content content = messageView.getContentManager().getContent(this);
if (content != null) {
messageView.getContentManager().removeContent(content, true);
}
}
use of com.intellij.ui.content.MessageView in project intellij-community by JetBrains.
the class TestErrorViewAction method openView.
protected void openView(Project project, JComponent component) {
final MessageView messageView = MessageView.SERVICE.getInstance(project);
final Content content = ContentFactory.SERVICE.getInstance().createContent(component, getContentName(), true);
messageView.getContentManager().addContent(content);
messageView.getContentManager().setSelectedContent(content);
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.MESSAGES_WINDOW);
if (toolWindow != null) {
toolWindow.activate(null);
}
}
Aggregations