Search in sources :

Example 11 with SimpleToolWindowPanel

use of com.intellij.openapi.ui.SimpleToolWindowPanel in project flutter-intellij by flutter.

the class FlutterConsole method create.

@NotNull
static FlutterConsole create(@NotNull Project project, @Nullable Module module) {
    final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
    builder.setViewer(true);
    if (module != null) {
        builder.addFilter(new FlutterConsoleFilter(module));
    }
    final ConsoleView view = builder.getConsole();
    final SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
    panel.setContent(view.getComponent());
    final String title = module != null ? "[" + module.getName() + "] Flutter" : "Flutter";
    final Content content = ContentFactory.SERVICE.getInstance().createContent(panel.getComponent(), title, true);
    Disposer.register(content, view);
    return new FlutterConsole(view, content, project, module);
}
Also used : TextConsoleBuilder(com.intellij.execution.filters.TextConsoleBuilder) ConsoleView(com.intellij.execution.ui.ConsoleView) Content(com.intellij.ui.content.Content) SimpleToolWindowPanel(com.intellij.openapi.ui.SimpleToolWindowPanel) NotNull(org.jetbrains.annotations.NotNull)

Example 12 with SimpleToolWindowPanel

use of com.intellij.openapi.ui.SimpleToolWindowPanel in project freeline by alibaba.

the class FreelineTerminal method getTerminalWidget.

public JBTabbedTerminalWidget getTerminalWidget(ToolWindow window) {
    window.show(null);
    if (myTerminalWidget == null) {
        JComponent parentPanel = window.getContentManager().getContents()[0].getComponent();
        if (parentPanel instanceof SimpleToolWindowPanel) {
            SimpleToolWindowPanel panel = (SimpleToolWindowPanel) parentPanel;
            JPanel jPanel = (JPanel) panel.getComponents()[0];
            myTerminalWidget = (JBTabbedTerminalWidget) jPanel.getComponents()[0];
        } else {
            NotificationUtils.infoNotification("Wait for Freeline to initialize");
        }
    }
    return myTerminalWidget;
}
Also used : SimpleToolWindowPanel(com.intellij.openapi.ui.SimpleToolWindowPanel)

Aggregations

SimpleToolWindowPanel (com.intellij.openapi.ui.SimpleToolWindowPanel)12 Content (com.intellij.ui.content.Content)8 ToolWindow (com.intellij.openapi.wm.ToolWindow)3 ContentManager (com.intellij.ui.content.ContentManager)3 TextConsoleBuilder (com.intellij.execution.filters.TextConsoleBuilder)2 ConsoleView (com.intellij.execution.ui.ConsoleView)2 ActionToolbar (com.intellij.openapi.actionSystem.ActionToolbar)2 ProcessAdapter (com.intellij.execution.process.ProcessAdapter)1 ProcessEvent (com.intellij.execution.process.ProcessEvent)1 JBRunnerTabs (com.intellij.execution.ui.layout.impl.JBRunnerTabs)1 TreeExpander (com.intellij.ide.TreeExpander)1 ContextHelpAction (com.intellij.ide.actions.ContextHelpAction)1 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1 Editor (com.intellij.openapi.editor.Editor)1 EditorEx (com.intellij.openapi.editor.ex.EditorEx)1 IgnoredSettingsAction (com.intellij.openapi.vcs.changes.actions.IgnoredSettingsAction)1 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)1 JBLabel (com.intellij.ui.components.JBLabel)1 TabbedContentAction (com.intellij.ui.content.tabs.TabbedContentAction)1 AbstractLayoutManager (com.intellij.util.ui.AbstractLayoutManager)1