当前位置: 首页>>代码示例>>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;未经允许,请勿转载。