@Override
 public void actionPerformed(final AnActionEvent e) {
   Project project = myEnvironment.getProject();
   if (project == null) return;
   if (myProcessHandler != null) {
     ExecutionManager.getInstance(project)
         .restartRunProfile(
             project,
             myExecutor,
             myEnvironment.getExecutionTarget(),
             myEnvironment.getRunnerAndConfigurationSettings(),
             myProcessHandler);
   } else {
     ExecutionManager.getInstance(project)
         .restartRunProfile(
             project,
             myExecutor,
             myEnvironment.getExecutionTarget(),
             myEnvironment.getRunnerAndConfigurationSettings(),
             myDescriptor);
   }
 }
  protected void showConsole(Executor defaultExecutor, RunContentDescriptor myDescriptor) {
    // Show in run toolwindow
    ExecutionManager.getInstance(myProject)
        .getContentManager()
        .showRunContent(defaultExecutor, myDescriptor);

    // Request focus
    final ToolWindow window =
        ToolWindowManager.getInstance(myProject).getToolWindow(defaultExecutor.getId());
    window.activate(
        new Runnable() {
          public void run() {
            IdeFocusManager.getInstance(myProject)
                .requestFocus(getLanguageConsole().getCurrentEditor().getContentComponent(), true);
          }
        });
  }