コード例 #1
0
 public void restart() {
   final Project project =
       PlatformDataKeys.PROJECT.getData(
           DataManager.getInstance().getDataContext(myDescriptor.getComponent()));
   if (ExecutorRegistry.getInstance()
       .isStarting(project, myExecutor.getId(), myRunner.getRunnerId())) {
     return;
   }
   try {
     final ExecutionEnvironment old = myEnvironment;
     myRunner.execute(
         myExecutor,
         new ExecutionEnvironment(
             old.getRunProfile(),
             old.getExecutionTarget(),
             project,
             old.getRunnerSettings(),
             old.getConfigurationSettings(),
             myDescriptor,
             old.getRunnerAndConfigurationSettings()));
   } catch (RunCanceledByUserException ignore) {
   } catch (ExecutionException e1) {
     Messages.showErrorDialog(
         project, e1.getMessage(), ExecutionBundle.message("restart.error.message.title"));
   }
 }
コード例 #2
0
    @Override
    public void done() {
      try {
        StringBuilder result = get();
        textArea.setText(result.toString());
        statusLine.setText("Done");
      } catch (InterruptedException ex) {
      } catch (CancellationException ex) {
        textArea.setText("");
        statusLine.setText("Cancelled");
      } catch (ExecutionException ex) {
        statusLine.setText("" + ex.getCause());
      }

      cancelItem.setEnabled(false);
      openItem.setEnabled(true);
    }