本文整理汇总了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));
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例13: addProcessListener
import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
public void addProcessListener(@NotNull final ProcessListener listener) {
myListeners.add(listener);
}
示例14: getProcessListeners
import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
@NotNull
public List<ProcessListener> getProcessListeners() {
return myListeners;
}
示例15: addProcessListener
import com.intellij.execution.process.ProcessListener; //导入依赖的package包/类
public void addProcessListener(ProcessListener listener) {
ProcessHandler handler = doGetProcessHandler();
if (handler != null) {
handler.addProcessListener(listener);
}
}