Search in sources :

Example 1 with TerminalWidget

use of com.jediterm.terminal.ui.TerminalWidget in project intellij-community by JetBrains.

the class AbstractTerminalRunner method initConsoleUI.

private void initConsoleUI(final T process) {
    final Executor defaultExecutor = DefaultRunExecutor.getRunExecutorInstance();
    final DefaultActionGroup toolbarActions = new DefaultActionGroup();
    final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, toolbarActions, false);
    final JPanel panel = new JPanel(new BorderLayout());
    panel.add(actionToolbar.getComponent(), BorderLayout.WEST);
    actionToolbar.setTargetComponent(panel);
    ProcessHandler processHandler = createProcessHandler(process);
    final RunContentDescriptor contentDescriptor = new RunContentDescriptor(null, processHandler, panel, getTerminalConnectionName(process));
    contentDescriptor.setAutoFocusContent(true);
    toolbarActions.add(createCloseAction(defaultExecutor, contentDescriptor));
    final JBTerminalSystemSettingsProvider provider = new JBTerminalSystemSettingsProvider();
    TerminalWidget widget = new JBTabbedTerminalWidget(myProject, provider, new Predicate<Pair<TerminalWidget, String>>() {

        @Override
        public boolean apply(Pair<TerminalWidget, String> widget) {
            openSessionInDirectory(widget.getFirst(), widget.getSecond());
            return true;
        }
    }, contentDescriptor);
    createAndStartSession(widget, createTtyConnector(process));
    panel.add(widget.getComponent(), BorderLayout.CENTER);
    showConsole(defaultExecutor, contentDescriptor, widget.getComponent());
    processHandler.startNotify();
}
Also used : RunContentDescriptor(com.intellij.execution.ui.RunContentDescriptor) DefaultRunExecutor(com.intellij.execution.executors.DefaultRunExecutor) Executor(com.intellij.execution.Executor) ProcessHandler(com.intellij.execution.process.ProcessHandler) TerminalWidget(com.jediterm.terminal.ui.TerminalWidget) Pair(com.intellij.openapi.util.Pair)

Aggregations

Executor (com.intellij.execution.Executor)1 DefaultRunExecutor (com.intellij.execution.executors.DefaultRunExecutor)1 ProcessHandler (com.intellij.execution.process.ProcessHandler)1 RunContentDescriptor (com.intellij.execution.ui.RunContentDescriptor)1 Pair (com.intellij.openapi.util.Pair)1 TerminalWidget (com.jediterm.terminal.ui.TerminalWidget)1