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();
}
Aggregations