Search in sources :

Example 21 with CommandProcessor

use of com.intellij.openapi.command.CommandProcessor in project intellij-community by JetBrains.

the class MessageViewHelper method openMessageViewImpl.

private void openMessageViewImpl() {
    CommandProcessor commandProcessor = CommandProcessor.getInstance();
    commandProcessor.executeCommand(myProject, () -> {
        MessageView messageView = MessageView.SERVICE.getInstance(myProject);
        Content content = ContentFactory.SERVICE.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));
        removeOldContents(content);
        messageView.getContentManager().addContentManagerListener(new MyContentDisposer(content, messageView, myKey));
    }, "Open Message View", null);
    ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.MESSAGES_WINDOW).activate(null);
}
Also used : CommandProcessor(com.intellij.openapi.command.CommandProcessor)

Example 22 with CommandProcessor

use of com.intellij.openapi.command.CommandProcessor in project intellij-community by JetBrains.

the class StdErrorReporter method openMessageView.

private void openMessageView() {
    CommandProcessor commandProcessor = CommandProcessor.getInstance();
    commandProcessor.executeCommand(myProject, () -> {
        MessageView messageView = MessageView.SERVICE.getInstance(myProject);
        final Content content = ContentFactory.SERVICE.getInstance().createContent(myErrorsView.getComponent(), CONTENT_NAME, true);
        content.putUserData(KEY, myErrorsView);
        messageView.getContentManager().addContent(content);
        messageView.getContentManager().setSelectedContent(content);
        messageView.getContentManager().addContentManagerListener(new CloseListener(content, messageView.getContentManager()));
        removeCompileContents(content);
        messageView.getContentManager().addContentManagerListener(new MyContentDisposer(content, messageView));
    }, XmlBundle.message("validate.xml.open.message.view.command.name"), null);
}
Also used : CommandProcessor(com.intellij.openapi.command.CommandProcessor)

Aggregations

CommandProcessor (com.intellij.openapi.command.CommandProcessor)22 Project (com.intellij.openapi.project.Project)8 FileEditorManagerEx (com.intellij.openapi.fileEditor.ex.FileEditorManagerEx)3 FindManager (com.intellij.find.FindManager)2 Editor (com.intellij.openapi.editor.Editor)2 FileEditor (com.intellij.openapi.fileEditor.FileEditor)2 EditorWindow (com.intellij.openapi.fileEditor.impl.EditorWindow)2 Content (com.intellij.ui.content.Content)2 MessageView (com.intellij.ui.content.MessageView)2 IncorrectOperationException (com.intellij.util.IncorrectOperationException)2 EditorGotoLineNumberDialog (com.intellij.ide.util.EditorGotoLineNumberDialog)1 GotoLineNumberDialog (com.intellij.ide.util.GotoLineNumberDialog)1 AbstractTreeNode (com.intellij.ide.util.treeView.AbstractTreeNode)1 DataContext (com.intellij.openapi.actionSystem.DataContext)1 ApplicationImpl (com.intellij.openapi.application.impl.ApplicationImpl)1 CommandAdapter (com.intellij.openapi.command.CommandAdapter)1 CommandEvent (com.intellij.openapi.command.CommandEvent)1 Document (com.intellij.openapi.editor.Document)1 DocumentImpl (com.intellij.openapi.editor.impl.DocumentImpl)1 EditorComposite (com.intellij.openapi.fileEditor.impl.EditorComposite)1