本文整理匯總了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));
}
}
示例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;
}
}
示例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();
}
}
}
示例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"));
}
}
});
}
});
}
示例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);
}
}
}
示例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;
}
示例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();
}
示例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);
}
}
示例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;
}
示例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);
}
示例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();
}
});
}
示例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();
}
});
}
}
}
示例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);
}
});
}
示例14: addProcessListener
import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
public void addProcessListener(ProcessListener listener) {
ProcessHandler handler = doGetProcessHandler();
if (handler != null) {
handler.addProcessListener(listener);
}
}
示例15: attachToProcess
import com.intellij.execution.process.ProcessHandler; //導入方法依賴的package包/類
@Override
public void attachToProcess(final ProcessHandler processHandler) {
super.attachToProcess(processHandler);
processHandler.addProcessListener(new MyProcessListener());
}