本文整理汇总了Java中com.intellij.execution.runners.DefaultProgramRunner类的典型用法代码示例。如果您正苦于以下问题:Java DefaultProgramRunner类的具体用法?Java DefaultProgramRunner怎么用?Java DefaultProgramRunner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultProgramRunner类属于com.intellij.execution.runners包,在下文中一共展示了DefaultProgramRunner类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startProcess
import com.intellij.execution.runners.DefaultProgramRunner; //导入依赖的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();
}
示例2: startProcess
import com.intellij.execution.runners.DefaultProgramRunner; //导入依赖的package包/类
private void startProcess(Target target, Parameters configuration, 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 = null;
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), processHandler);
return;
}
processHandler.addProcessListener(getProcessListener(key));
processHandler.startNotify();
}
示例3: startProcess
import com.intellij.execution.runners.DefaultProgramRunner; //导入依赖的package包/类
private void startProcess(Target target, Parameters configuration, Pair<Target, Parameters> key) {
ProgramRunner runner = new DefaultProgramRunner() {
@Override
@Nonnull
public String getRunnerId() {
return "MyRunner";
}
@Override
public boolean canRun(@Nonnull String executorId, @Nonnull RunProfile profile) {
return true;
}
};
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
ProcessHandler processHandler = null;
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), processHandler);
return;
}
processHandler.addProcessListener(getProcessListener(key));
processHandler.startNotify();
}