com.intellij.execution.ui.ExecutionConsole Java Examples

The following examples show how to use com.intellij.execution.ui.ExecutionConsole. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SmRunnerUtils.java    From intellij with Apache License 2.0 6 votes vote down vote up
@Nullable
public static AbstractRerunFailedTestsAction createRerunFailedTestsAction(
    DefaultExecutionResult result) {
  ExecutionConsole console = result.getExecutionConsole();
  if (!(console instanceof SMTRunnerConsoleView)) {
    return null;
  }
  SMTRunnerConsoleView smConsole = (SMTRunnerConsoleView) console;
  TestConsoleProperties consoleProperties = smConsole.getProperties();
  if (!(consoleProperties instanceof BlazeTestConsoleProperties)) {
    return null;
  }
  BlazeTestConsoleProperties properties = (BlazeTestConsoleProperties) consoleProperties;
  AbstractRerunFailedTestsAction action = properties.createRerunFailedTestsAction(smConsole);
  if (action != null) {
    action.init(properties);
    action.setModelProvider(smConsole::getResultsViewer);
  }
  return action;
}
 
Example #2
Source File: RunnerUtil.java    From react-native-console with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public static final ConsoleView showHelperProcessRunContent(String header, OSProcessHandler runHandler, Project project, Executor defaultExecutor) {
        ProcessTerminatedListener.attach(runHandler);

        ConsoleViewImpl consoleView = new ConsoleViewImpl(project, true);
        DefaultActionGroup toolbarActions = new DefaultActionGroup();

        JPanel panel = new JPanel((LayoutManager) new BorderLayout());
        panel.add((Component) consoleView.getComponent(), "Center");
        ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("unknown", (ActionGroup) toolbarActions, false);
        toolbar.setTargetComponent(consoleView.getComponent());
        panel.add((Component) toolbar.getComponent(), "West");

        RunContentDescriptor runDescriptor = new RunContentDescriptor((ExecutionConsole) consoleView,
                (ProcessHandler) runHandler, (JComponent) panel, header, AllIcons.RunConfigurations.Application);
        AnAction[]
                consoleActions = consoleView.createConsoleActions();
        toolbarActions.addAll((AnAction[]) Arrays.copyOf(consoleActions, consoleActions.length));
        toolbarActions.add((AnAction) new StopProcessAction("Stop process", "Stop process", (ProcessHandler) runHandler));
        toolbarActions.add((AnAction) new CloseAction(defaultExecutor, runDescriptor, project));

        consoleView.attachToProcess((ProcessHandler) runHandler);
//        ExecutionManager.getInstance(environment.getProject()).getContentManager().showRunContent(environment.getExecutor(), runDescriptor);
        showConsole(project, defaultExecutor, runDescriptor);
        return (ConsoleView) consoleView;
    }
 
Example #3
Source File: AnalyzeStacktraceUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
public MyConsolePanel(ExecutionConsole consoleView, ActionGroup toolbarActions) {
  super(new BorderLayout());
  JPanel toolbarPanel = new JPanel(new BorderLayout());
  toolbarPanel.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, toolbarActions, false).getComponent());
  add(toolbarPanel, BorderLayout.WEST);
  add(consoleView.getComponent(), BorderLayout.CENTER);
}
 
Example #4
Source File: RunTab.java    From consulo with Apache License 2.0 5 votes vote down vote up
protected final void initLogConsoles(@Nonnull RunProfile runConfiguration, @Nonnull RunContentDescriptor contentDescriptor, @Nullable ExecutionConsole console) {
  ProcessHandler processHandler = contentDescriptor.getProcessHandler();
  if (runConfiguration instanceof RunConfigurationBase) {
    RunConfigurationBase configuration = (RunConfigurationBase)runConfiguration;
    if (myManager == null) {
      myManager = new LogFilesManager(getLogConsoleManager());
    }
    myManager.addLogConsoles(configuration, processHandler);
    if (processHandler != null) {
      OutputFileUtil.attachDumpListener(configuration, processHandler, console);
    }
  }
}
 
Example #5
Source File: XDebuggerManagerImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
@Nullable
public XDebugSession getDebugSession(@Nonnull ExecutionConsole executionConsole) {
  for (final XDebugSessionImpl debuggerSession : mySessions.values()) {
    XDebugSessionTab sessionTab = debuggerSession.getSessionTab();
    if (sessionTab != null) {
      RunContentDescriptor contentDescriptor = sessionTab.getRunContentDescriptor();
      if (contentDescriptor != null && executionConsole == contentDescriptor.getExecutionConsole()) {
        return debuggerSession;
      }
    }
  }
  return null;
}
 
Example #6
Source File: UnityDebugProcess.java    From consulo-unity3d with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public ExecutionConsole createConsole()
{
	if(myConsoleView != null)
	{
		return myConsoleView;
	}
	ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(getSession().getProject()).getConsole();
	consoleView.attachToProcess(getProcessHandler());
	return consoleView;
}
 
Example #7
Source File: XDebugTabLayouter.java    From consulo with Apache License 2.0 5 votes vote down vote up
/**
 * Registers tab for the given {@code console}.
 *
 * @param console {@code ExecutionConsole} instance
 * @param ui {@code RunnerLayoutUi} instance
 * @return registered {@code Content} instance
 */
@Nonnull
public Content registerConsoleContent(@Nonnull RunnerLayoutUi ui, @Nonnull ExecutionConsole console) {
  Content content = ui.createContent(DebuggerContentInfo.CONSOLE_CONTENT, console.getComponent(),
                                     XDebuggerBundle.message("debugger.session.tab.console.content.name"),
                                     AllIcons.Debugger.Console,
                                     console.getPreferredFocusableComponent());
  content.setCloseable(false);
  ui.addContent(content, 1, PlaceInGrid.bottom, false);
  return content;
}
 
Example #8
Source File: XQueryDebugProcess.java    From intellij-xquery with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public ExecutionConsole createConsole() {
    return executionConsole;
}
 
Example #9
Source File: DefaultExecutionResult.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public ExecutionConsole getExecutionConsole() {
  return myConsole;
}
 
Example #10
Source File: DefaultExecutionResult.java    From consulo with Apache License 2.0 4 votes vote down vote up
public DefaultExecutionResult(final ExecutionConsole console, @Nonnull final ProcessHandler processHandler, final AnAction... actions) {
  myConsole = console;
  myProcessHandler = processHandler;
  myActions = actions;
}
 
Example #11
Source File: DefaultExecutionResult.java    From consulo with Apache License 2.0 4 votes vote down vote up
public DefaultExecutionResult(final ExecutionConsole console, @Nonnull final ProcessHandler processHandler) {
  this(console, processHandler, AnAction.EMPTY_ARRAY);
}
 
Example #12
Source File: XDebugProcess.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
public ExecutionConsole createConsole() {
  return TextConsoleBuilderFactory.getInstance().createBuilder(getSession().getProject()).getConsole();
}
 
Example #13
Source File: XDebuggerManager.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nullable
public abstract XDebugSession getDebugSession(@Nonnull ExecutionConsole executionConsole);
 
Example #14
Source File: TestConsoleProperties.java    From consulo with Apache License 2.0 4 votes vote down vote up
protected ExecutionConsole getConsole() {
  return myConsole;
}
 
Example #15
Source File: HaxeDebugRunner.java    From intellij-haxe with Apache License 2.0 4 votes vote down vote up
@Override
@NotNull
public ExecutionConsole createConsole() {
  return ((mExecutionResult == null) ? super.createConsole() :
          mExecutionResult.getExecutionConsole());
}
 
Example #16
Source File: BashTerminalCommandLineState.java    From BashSupport with Apache License 2.0 4 votes vote down vote up
@Override
public ExecutionConsole getExecutionConsole() {
    return null;
}
 
Example #17
Source File: SkylarkDebugProcess.java    From intellij with Apache License 2.0 4 votes vote down vote up
@Override
public ExecutionConsole createConsole() {
  return executionResult.getExecutionConsole();
}
 
Example #18
Source File: DartVmServiceDebugProcess.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@NotNull
@Override
public ExecutionConsole createConsole() {
  return myExecutionResult == null ? super.createConsole() : myExecutionResult.getExecutionConsole();
}
 
Example #19
Source File: DartVmServiceDebugProcess.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@NotNull
@Override
public ExecutionConsole createConsole() {
  return myExecutionResult == null ? super.createConsole() : myExecutionResult.getExecutionConsole();
}
 
Example #20
Source File: WeaveDebugProcess.java    From mule-intellij-plugins with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public ExecutionConsole createConsole()
{
    return executionConsole;
}
 
Example #21
Source File: ContextAwareDebugProcess.java    From mule-intellij-plugins with Apache License 2.0 4 votes vote down vote up
@Override
@NotNull
public ExecutionConsole createConsole() {
    return getDefaultDebugProcesses().createConsole();
}
 
Example #22
Source File: MuleDebugProcess.java    From mule-intellij-plugins with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public ExecutionConsole createConsole() {
  return executionConsole != null ? executionConsole : super.createConsole();
}
 
Example #23
Source File: ExecutionResult.java    From consulo with Apache License 2.0 votes vote down vote up
ExecutionConsole getExecutionConsole();