当前位置: 首页>>代码示例>>Java>>正文


Java ProcessListener类代码示例

本文整理汇总了Java中com.intellij.execution.process.ProcessListener的典型用法代码示例。如果您正苦于以下问题:Java ProcessListener类的具体用法?Java ProcessListener怎么用?Java ProcessListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ProcessListener类属于com.intellij.execution.process包,在下文中一共展示了ProcessListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ScopedBlazeProcessHandler

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
public ScopedBlazeProcessHandler(
    Project project,
    List<String> command,
    WorkspaceRoot workspaceRoot,
    ScopedProcessHandlerDelegate scopedProcessHandlerDelegate)
    throws ExecutionException {
  super(new GeneralCommandLine(command).withWorkDirectory(workspaceRoot.directory().getPath()));

  this.scopedProcessHandlerDelegate = scopedProcessHandlerDelegate;
  this.context = new BlazeContext();
  // The context is released in the ScopedProcessHandlerListener.
  this.context.hold();

  for (ProcessListener processListener :
      scopedProcessHandlerDelegate.createProcessListeners(context)) {
    addProcessListener(processListener);
  }
  addProcessListener(new ScopedProcessHandlerListener(project));
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:20,代码来源:ScopedBlazeProcessHandler.java

示例2: clearRestarterListener

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
private static void clearRestarterListener(@NotNull ProcessHandler processHandler) {
  ProcessListener restarterListener = ON_TERMINATION_RESTARTER_KEY.get(processHandler, null);
  if (restarterListener != null) {
    processHandler.removeProcessListener(restarterListener);
    ON_TERMINATION_RESTARTER_KEY.set(processHandler, null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AutoTestManager.java

示例3: runTool

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
static void runTool(String actionId,
                    DataContext context,
                    @Nullable AnActionEvent e,
                    long executionId,
                    @Nullable ProcessListener processListener) {
  Tool tool = findTool(actionId, context);
  if (tool != null) {
    tool.execute(e, new HackyDataContext(context), executionId, processListener);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ToolAction.java

示例4: execute

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
public void execute(AnActionEvent event, DataContext dataContext, long executionId, @Nullable final ProcessListener processListener) {
  final Project project = CommonDataKeys.PROJECT.getData(dataContext);
  if (project == null) {
    return;
  }

  FileDocumentManager.getInstance().saveAllDocuments();
  try {
    if (isUseConsole()) {
      ExecutionEnvironment environment = ExecutionEnvironmentBuilder.create(project,
                                                                            DefaultRunExecutor.getRunExecutorInstance(),
                                                                            new ToolRunProfile(this, dataContext)).build();
      environment.setExecutionId(executionId);
      environment.getRunner().execute(environment, new ProgramRunner.Callback() {
        @Override
        public void processStarted(RunContentDescriptor descriptor) {
          ProcessHandler processHandler = descriptor.getProcessHandler();
          if (processHandler != null && processListener != null) {
            processHandler.addProcessListener(processListener);
          }
        }
      });
    }
    else {
      GeneralCommandLine commandLine = createCommandLine(dataContext);
      if (commandLine == null) {
        return;
      }
      OSProcessHandler handler = new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
      handler.addProcessListener(new ToolProcessAdapter(project, synchronizeAfterExecution(), getName()));
      if (processListener != null) {
        handler.addProcessListener(processListener);
      }
      handler.startNotify();
    }
  }
  catch (ExecutionException ex) {
    ExecutionErrorDialog.show(ex, ToolsBundle.message("tools.process.start.error"), project);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:Tool.java

示例5: addProcessListener

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
public void addProcessListener(ProcessListener processListener) {
  synchronized(myProcessListeners) {
    if(getExecutionResult() != null) {
      getExecutionResult().getProcessHandler().addProcessListener(processListener);
    }
    else {
      myProcessListeners.add(processListener);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:DebugProcessImpl.java

示例6: removeProcessListener

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
public void removeProcessListener(ProcessListener processListener) {
  synchronized (myProcessListeners) {
    if(getExecutionResult() != null) {
      getExecutionResult().getProcessHandler().removeProcessListener(processListener);
    }
    else {
      myProcessListeners.remove(processListener);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:DebugProcessImpl.java

示例7: runTool

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
/**
 * @return <code>true</code> if task has been started successfully
 */
static boolean runTool(String actionId, DataContext context, @Nullable AnActionEvent e, long executionId, @Nullable ProcessListener processListener) {
  Tool tool = findTool(actionId, context);
  if (tool != null) {
    return tool.execute(e, new HackyDataContext(context, e), executionId, processListener);
  }
  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:ToolAction.java

示例8: clearRestarterListener

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
private static void clearRestarterListener(@Nonnull ProcessHandler processHandler) {
  ProcessListener restarterListener = ON_TERMINATION_RESTARTER_KEY.get(processHandler, null);
  if (restarterListener != null) {
    processHandler.removeProcessListener(restarterListener);
    ON_TERMINATION_RESTARTER_KEY.set(processHandler, null);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:AbstractAutoTestManager.java

示例9: createProcessListener

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
@Override
public ProcessListener createProcessListener(Project project, UserDataHolder extensionData)
{
	final Integer port = extensionData.getUserData(PORT);
	assert port != null;
	return new DebugProcessListener(project, port);
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:8,代码来源:XsltDebuggerExtension.java

示例10: addProcessListener

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
public void addProcessListener(ProcessListener processListener)
{
	synchronized(myProcessListeners)
	{
		if(getProcessHandler() != null)
		{
			getProcessHandler().addProcessListener(processListener);
		}
		else
		{
			myProcessListeners.add(processListener);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:15,代码来源:DebugProcessImpl.java

示例11: removeProcessListener

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
public void removeProcessListener(ProcessListener processListener)
{
	synchronized(myProcessListeners)
	{
		if(getProcessHandler() != null)
		{
			getProcessHandler().removeProcessListener(processListener);
		}
		else
		{
			myProcessListeners.remove(processListener);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:15,代码来源:DebugProcessImpl.java

示例12: addListener

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
public void addListener(ProcessListener outputListener) {
    m_outputListener = outputListener;
    if (m_bsb != null) {
        m_bsb.addProcessListener(outputListener);
    }
}
 
开发者ID:reasonml-editor,项目名称:reasonml-idea-plugin,代码行数:7,代码来源:BsCompiler.java

示例13: addProcessListener

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
public void addProcessListener(@NotNull final ProcessListener listener) {
  myListeners.add(listener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ExecutionMode.java

示例14: getProcessListeners

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
@NotNull
public List<ProcessListener> getProcessListeners() {
  return myListeners;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ExecutionMode.java

示例15: addProcessListener

import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
public void addProcessListener(ProcessListener listener) {
  ProcessHandler handler = doGetProcessHandler();
  if (handler != null) {
    handler.addProcessListener(listener);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:PyDebugProcess.java


注:本文中的com.intellij.execution.process.ProcessListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。