Search in sources :

Example 81 with Content

use of com.intellij.ui.content.Content in project android by JetBrains.

the class BuildVariantsToolWindowFixture method getTestArtifactComboBox.

@NotNull
private JComboBoxFixture getTestArtifactComboBox() {
    activate();
    Content[] contents = myToolWindow.getContentManager().getContents();
    assertThat(contents.length).isAtLeast(1);
    Content content = contents[0];
    JComboBox comboBox = myRobot.finder().findByType(content.getComponent(), JComboBox.class, true);
    return new JComboBoxFixture(myRobot, comboBox);
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) Content(com.intellij.ui.content.Content) NotNull(org.jetbrains.annotations.NotNull)

Example 82 with Content

use of com.intellij.ui.content.Content in project intellij-plugins by JetBrains.

the class DartPubActionBase method showPubOutputConsole.

private static void showPubOutputConsole(@NotNull final Module module, @NotNull final GeneralCommandLine command, @NotNull final OSProcessHandler processHandler, @NotNull final VirtualFile pubspecYamlFile, @NotNull final String actionTitle) {
    final ConsoleView console;
    PubToolWindowContentInfo info = findExistingInfoForCommand(module.getProject(), command);
    if (info != null) {
        // rerunning the same pub command in the same tool window tab (corresponding tool window action invoked)
        console = info.console;
        console.clear();
    } else {
        console = createConsole(module.getProject(), pubspecYamlFile);
        info = new PubToolWindowContentInfo(module, pubspecYamlFile, command, actionTitle, console);
        final ActionToolbar actionToolbar = createToolWindowActionsBar(info);
        final SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(false, true);
        toolWindowPanel.setContent(console.getComponent());
        toolWindowPanel.setToolbar(actionToolbar.getComponent());
        final Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel.getComponent(), actionTitle, true);
        content.putUserData(PUB_TOOL_WINDOW_CONTENT_INFO_KEY, info);
        Disposer.register(content, console);
        final ContentManager contentManager = MessageView.SERVICE.getInstance(module.getProject()).getContentManager();
        removeOldTabs(contentManager);
        contentManager.addContent(content);
        contentManager.setSelectedContent(content);
        final ToolWindow toolWindow = ToolWindowManager.getInstance(module.getProject()).getToolWindow(ToolWindowId.MESSAGES_WINDOW);
        toolWindow.activate(null, true);
    }
    info.rerunPubCommandAction.setProcessHandler(processHandler);
    info.stopProcessAction.setProcessHandler(processHandler);
    processHandler.addProcessListener(new ProcessAdapter() {

        @Override
        public void processTerminated(final ProcessEvent event) {
            console.print(IdeBundle.message("finished.with.exit.code.text.message", event.getExitCode()), ConsoleViewContentType.SYSTEM_OUTPUT);
        }
    });
    console.print(DartBundle.message("working.dir.0", FileUtil.toSystemDependentName(pubspecYamlFile.getParent().getPath())) + "\n", ConsoleViewContentType.SYSTEM_OUTPUT);
    console.attachToProcess(processHandler);
    processHandler.startNotify();
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) ProcessAdapter(com.intellij.execution.process.ProcessAdapter) ConsoleView(com.intellij.execution.ui.ConsoleView) ProcessEvent(com.intellij.execution.process.ProcessEvent) Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager) SimpleToolWindowPanel(com.intellij.openapi.ui.SimpleToolWindowPanel)

Example 83 with Content

use of com.intellij.ui.content.Content in project android by JetBrains.

the class BuildVariantView method createToolWindowContent.

/**
   * Creates the contents of the "Build Variants" tool window.
   *
   * @param toolWindow the tool window whose contents will be created.
   */
public void createToolWindowContent(@NotNull ToolWindow toolWindow) {
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(myToolWindowPanel, "", false);
    toolWindow.getContentManager().addContent(content);
    updateContents();
}
Also used : Content(com.intellij.ui.content.Content) ContentFactory(com.intellij.ui.content.ContentFactory)

Example 84 with Content

use of com.intellij.ui.content.Content in project android by JetBrains.

the class AndroidDebuggerImplBase method activateDebugSessionWindow.

protected static boolean activateDebugSessionWindow(@NotNull Project project, @NotNull RunContentDescriptor descriptor) {
    final ProcessHandler processHandler = descriptor.getProcessHandler();
    final Content content = descriptor.getAttachedContent();
    if (processHandler == null || content == null) {
        return false;
    }
    final Executor executor = DefaultDebugExecutor.getDebugExecutorInstance();
    if (processHandler.isProcessTerminated()) {
        ExecutionManager.getInstance(project).getContentManager().removeRunContent(executor, descriptor);
        return false;
    }
    content.getManager().setSelectedContent(content);
    ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(executor.getToolWindowId());
    window.activate(null, false, true);
    return true;
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) DefaultDebugExecutor(com.intellij.execution.executors.DefaultDebugExecutor) Executor(com.intellij.execution.Executor) Content(com.intellij.ui.content.Content) ProcessHandler(com.intellij.execution.process.ProcessHandler)

Example 85 with Content

use of com.intellij.ui.content.Content in project android by JetBrains.

the class CapturesToolWindowFactory method createToolWindowContent.

@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
    CapturesToolWindow view = new CapturesToolWindow(project);
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(view.getComponent(), "", false);
    toolWindow.getContentManager().addContent(content);
}
Also used : Content(com.intellij.ui.content.Content) ContentFactory(com.intellij.ui.content.ContentFactory)

Aggregations

Content (com.intellij.ui.content.Content)157 ContentManager (com.intellij.ui.content.ContentManager)42 ToolWindow (com.intellij.openapi.wm.ToolWindow)37 NotNull (org.jetbrains.annotations.NotNull)19 ContentFactory (com.intellij.ui.content.ContentFactory)14 Project (com.intellij.openapi.project.Project)13 Nullable (org.jetbrains.annotations.Nullable)13 MessageView (com.intellij.ui.content.MessageView)10 Disposable (com.intellij.openapi.Disposable)8 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)8 RunnerLayoutUi (com.intellij.execution.ui.RunnerLayoutUi)7 ToolWindowManagerEx (com.intellij.openapi.wm.ex.ToolWindowManagerEx)7 ConsoleView (com.intellij.execution.ui.ConsoleView)6 SimpleToolWindowPanel (com.intellij.openapi.ui.SimpleToolWindowPanel)6 TabbedContent (com.intellij.ui.content.TabbedContent)6 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)5 Ref (com.intellij.openapi.util.Ref)5 ExecutionConsole (com.intellij.execution.ui.ExecutionConsole)4 ToolWindowManagerAdapter (com.intellij.openapi.wm.ex.ToolWindowManagerAdapter)4 Assert.assertNotNull (junit.framework.Assert.assertNotNull)4