當前位置: 首頁>>代碼示例>>Java>>正文


Java ProcessHandler.addProcessListener方法代碼示例

本文整理匯總了Java中com.intellij.execution.process.ProcessHandler.addProcessListener方法的典型用法代碼示例。如果您正苦於以下問題:Java ProcessHandler.addProcessListener方法的具體用法?Java ProcessHandler.addProcessListener怎麽用?Java ProcessHandler.addProcessListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.execution.process.ProcessHandler的用法示例。


在下文中一共展示了ProcessHandler.addProcessListener方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createListener

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
private void createListener(@NotNull RunContentDescriptor descriptor, Integer descriptorHashCode) {
    DebugSessionInfo sessionInfo = new DebugSessionInfo("run/debug");

    ProcessHandler processHandler = descriptor.getProcessHandler();
    if (processHandler != null) {
        ExecutionConsole console = descriptor.getExecutionConsole();
        if (console instanceof ConsoleView) {
            ConsoleViewImpl impl = extractConsoleImpl((ConsoleView) console);
            if (impl != null) {
                new ConsoleWatcher(myProject, impl, sessionInfo);
            }
        }
        final LogScannerFactory scannerFactory = new StackTraceMatcherFactory(myProject, sessionInfo);
        RunDebugAdapter listener = new RunDebugAdapter(scannerFactory);
        listeners.put(descriptorHashCode, listener);
        debugSessionIds.put(descriptorHashCode, sessionInfo);
        processHandler.addProcessListener(listener);

        TrackingService.trace(IdeaRawEvent.debugStart(myProject, sessionInfo));
    }
}
 
開發者ID:samebug,項目名稱:samebug-idea-plugin,代碼行數:22,代碼來源:RunDebugWatcher.java

示例2: ConsoleViewRunningState

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
public ConsoleViewRunningState(final ConsoleViewImpl console, final ProcessHandler processHandler,
                               final ConsoleState finishedStated,
                               final boolean attachToStdOut,
                               final boolean attachToStdIn) {

  myConsole = console;
  myProcessHandler = processHandler;
  myFinishedStated = finishedStated;

  // attach to process stdout
  if (attachToStdOut) {
    processHandler.addProcessListener(myProcessListener);
  }

  // attach to process stdin
  if (attachToStdIn) {
    final OutputStream processInput = myProcessHandler.getProcessInput();
    myUserInputWriter = processInput != null ? createOutputStreamWriter(processInput, processHandler) : null;
  }
  else {
    myUserInputWriter = null;
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:24,代碼來源:ConsoleViewRunningState.java

示例3: tryToCloseOldSessions

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
private static void tryToCloseOldSessions(final Executor executor, Project project) {
  final ExecutionManager manager = ExecutionManager.getInstance(project);
  ProcessHandler[] processes = manager.getRunningProcesses();
  for (ProcessHandler process : processes) {
    final AndroidSessionInfo info = process.getUserData(ANDROID_SESSION_INFO);
    if (info != null) {
      process.addProcessListener(new ProcessAdapter() {
        @Override
        public void processTerminated(ProcessEvent event) {
          ApplicationManager.getApplication().invokeLater(new Runnable() {
            @Override
            public void run() {
              manager.getContentManager().removeRunContent(executor, info.getDescriptor());
            }
          });
        }
      });
      process.detachProcess();
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:AndroidDebugRunner.java

示例4: onProcessStarted

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
public void onProcessStarted(final ProcessHandler process) {
  if (myTestsBuilt) return;
  process.addProcessListener(new ProcessAdapter() {
    @Override
    public void processTerminated(ProcessEvent event) {
      process.removeProcessListener(this);
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
          myStateInfo.setTerminated(myState);
          if (!myTestsBuilt && myProgressBar.getValue() == 0) {
            setStatusColor(ColorProgressBar.RED);
            setFraction(1.0);
            myState.append(ExecutionBundle.message("junit.running.info.failed.to.start.error.message"));
          }
        }
      });
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:JUnitStatusLine.java

示例5: createAdditionalTabComponents

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
@Override
public void createAdditionalTabComponents(final AdditionalTabComponentManager manager, ProcessHandler startedProcess) {
  if (myOutputType == OutputType.CONSOLE) {
    final HighlightingOutputConsole console = new HighlightingOutputConsole(getProject(), myFileType);

      XsltCommandLineState state = startedProcess.getUserData(XsltCommandLineState.STATE);
      boolean debug = state != null && state.isDebugger();
      boolean consoleTabAdded = false;
    for (XsltRunnerExtension extension : XsltRunnerExtension.getExtensions(this, debug)) {
      if (extension.createTabs(getProject(), manager, console, startedProcess)) {
        consoleTabAdded = true;
      }
    }
    if (!consoleTabAdded) {
      manager.addAdditionalTabComponent(console, console.getTabTitle());    // TODO: verify parameter
    }

    final OutputTabAdapter listener = new OutputTabAdapter(startedProcess, console);
    if (startedProcess.isStartNotified()) {
      listener.startNotified(new ProcessEvent(startedProcess));
    }
    else {
      startedProcess.addProcessListener(listener);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:XsltRunConfiguration.java

示例6: doCreateProcess

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
@Override
protected ProcessHandler doCreateProcess(GeneralCommandLine commandLine) throws ExecutionException {
  ProcessHandler handler = super.doCreateProcess(commandLine);
  handler.addProcessListener(new ProcessAdapter() {
    @Override
    public void processTerminated(@NotNull ProcessEvent event) {
      ApplicationManager.getApplication().invokeLater(() -> EduUtils.deleteWindowDescriptions(myTask, myTaskDir));
    }
  });
  return handler;
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:12,代碼來源:PyCCCommandLineState.java

示例7: startProcess

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
private void startProcess(Target target, Parameters configuration, @NotNull Pair<Target, Parameters> key) {
  ProgramRunner runner = new DefaultProgramRunner() {
    @Override
    @NotNull
    public String getRunnerId() {
      return "MyRunner";
    }

    @Override
    public boolean canRun(@NotNull String executorId, @NotNull RunProfile profile) {
      return true;
    }
  };
  Executor executor = DefaultRunExecutor.getRunExecutorInstance();
  ProcessHandler processHandler;
  try {
    RunProfileState state = getRunProfileState(target, configuration, executor);
    ExecutionResult result = state.execute(executor, runner);
    //noinspection ConstantConditions
    processHandler = result.getProcessHandler();
  }
  catch (Exception e) {
    dropProcessInfo(key, e instanceof ExecutionException? e.getMessage() : ExceptionUtil.getUserStackTrace(e, LOG), null);
    return;
  }
  processHandler.addProcessListener(getProcessListener(key));
  processHandler.startNotify();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:RemoteProcessSupport.java

示例8: attachStopLogConsoleTrackingListener

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
public void attachStopLogConsoleTrackingListener(final ProcessHandler process) {
  if (process != null) {
    final ProcessAdapter stopListener = new ProcessAdapter() {
      @Override
      public void processTerminated(final ProcessEvent event) {
        process.removeProcessListener(this);
        stopRunning(true);
      }
    };
    process.addProcessListener(stopListener);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:LogConsoleBase.java

示例9: doCreateProcess

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
protected ProcessHandler doCreateProcess(GeneralCommandLine commandLine) throws ExecutionException {
  final Runnable afterTask = getAfterTask();
  ProcessHandler processHandler = PythonProcessRunner.createProcess(commandLine, false);
  if (afterTask != null) {
    processHandler.addProcessListener(new ProcessAdapter() {
                                          public void processTerminated(ProcessEvent event) {
                                            SwingUtilities.invokeLater(afterTask);
                                          }});
  }
  return processHandler;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:RestCommandLineState.java

示例10: AndroidProcessText

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
private AndroidProcessText(@NotNull ProcessHandler processHandler) {
  processHandler.addProcessListener(new ProcessAdapter() {
    @Override
    public void onTextAvailable(ProcessEvent event, Key outputType) {
      synchronized (myFragments) {
        myFragments.add(new MyFragment(event.getText(), outputType));
      }
    }
  });
  processHandler.putUserData(KEY, this);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:AndroidProcessText.java

示例11: attachToProcess

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
public void attachToProcess(ProcessHandler processHandler) {
  myConsoleView.attachToProcess(processHandler);
  processHandler.addProcessListener(new ProcessAdapter() {
    @Override
    public void onTextAvailable(ProcessEvent event, Key outputType) {
      ensureAttachedToToolWindow();
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:MavenConsoleImpl.java

示例12: attachToProcess

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
public void attachToProcess(@NotNull final RunConfigurationBase configuration, @NotNull final ProcessHandler handler, RunnerSettings runnerSettings) {
  SnapShooterConfigurationSettings settings = configuration.getUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY);
  if (settings != null) {
    final Runnable runnable = settings.getNotifyRunnable();
    if (runnable != null) {
      settings.setNotifyRunnable(null);
      handler.addProcessListener(new ProcessAdapter() {
        public void startNotified(final ProcessEvent event) {
          runnable.run();
        }
      });
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:SnapShooterConfigurationExtension.java

示例13: attachToProcess

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
public void attachToProcess(@NotNull final ProcessHandler handler,
                            @NotNull final RunConfigurationBase configuration,
                            final RunnerSettings runnerSettings) {
  handler.addProcessListener(new ProcessAdapter() {
    public void processTerminated(final ProcessEvent event) {
      processGatheredCoverage(configuration, runnerSettings);
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:CoverageDataManagerImpl.java

示例14: addProcessListener

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
public void addProcessListener(ProcessListener listener) {
  ProcessHandler handler = doGetProcessHandler();
  if (handler != null) {
    handler.addProcessListener(listener);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:PyDebugProcess.java

示例15: attachToProcess

import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
@Override
public void attachToProcess(final ProcessHandler processHandler) {
  super.attachToProcess(processHandler);
  processHandler.addProcessListener(new MyProcessListener());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:CommandConsole.java


注:本文中的com.intellij.execution.process.ProcessHandler.addProcessListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。