本文整理汇总了Java中com.intellij.execution.ProgramRunnerUtil.executeConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java ProgramRunnerUtil.executeConfiguration方法的具体用法?Java ProgramRunnerUtil.executeConfiguration怎么用?Java ProgramRunnerUtil.executeConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.ProgramRunnerUtil
的用法示例。
在下文中一共展示了ProgramRunnerUtil.executeConfiguration方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAndRunConfiguration
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
@Override
public void createAndRunConfiguration(@NotNull ServerType<?> serverType, @Nullable RemoteServer<?> remoteServer) {
DeployToServerConfigurationType configurationType = DeployToServerConfigurationTypesRegistrar.getDeployConfigurationType(serverType);
RunManagerEx runManager = RunManagerEx.getInstanceEx(myProject);
ConfigurationFactoryEx factory = configurationType.getFactory();
RunnerAndConfigurationSettings settings = runManager.createRunConfiguration(configurationType.getDisplayName(), factory);
factory.onNewConfigurationCreated(settings.getConfiguration());
DeployToServerRunConfiguration<?, ?> runConfiguration = (DeployToServerRunConfiguration<?, ?>)settings.getConfiguration();
if (remoteServer != null) {
runConfiguration.setServerName(remoteServer.getName());
}
if (RunDialog.editConfiguration(myProject, settings, "Create Deployment Configuration",
DefaultRunExecutor.getRunExecutorInstance())) {
runManager.addConfiguration(settings, runManager.isConfigurationShared(settings), runManager.getBeforeRunTasks(runConfiguration),
false);
runManager.setSelectedConfiguration(settings);
ProgramRunnerUtil.executeConfiguration(myProject, settings, DefaultRunExecutor.getRunExecutorInstance());
}
}
示例2: execute
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
/**
* Runs specified TaskConfiguration: generates code and then runs output configuration.
*
* @throws ClassCastException if {@code environment.getRunProfile()} is not {@link TaskConfiguration}.
* @throws ExecutionException if output configuration throws it.
* @see ExecutionEnvironment#getRunProfile()
*/
@Override
public void execute(@NotNull ExecutionEnvironment environment, @Nullable Callback callback) throws
ExecutionException {
Project project = environment.getProject();
TaskConfiguration taskConfiguration = (TaskConfiguration) environment.getRunProfile();
generateSubmissionFileForTask(project, taskConfiguration);
generateRunFileForTask(project, taskConfiguration);
List<RunnerAndConfigurationSettings> allSettings = RunManager.getInstance(project).getAllSettings();
RunnerAndConfigurationSettings outputSettings = null;
for (RunnerAndConfigurationSettings configuration : allSettings) {
if (configuration.getName().equals(RUN_CONFIGURATION_NAME)) {
outputSettings = configuration;
}
}
if (outputSettings == null) {
throw new NotificationException("No run configuration found", "It should be called (" + RUN_CONFIGURATION_NAME + ")");
}
ProgramRunnerUtil.executeConfiguration(project, outputSettings, environment.getExecutor());
}
示例3: executeDebugRunner
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
/**
* Run tests for given element
*
* @param psiElement Elements are PhpClass or Method possible context
*/
public static void executeDebugRunner(@NotNull PsiElement psiElement) {
ConfigurationFromContext context = RunConfigurationProducer.getInstance(BehatRuntimeConfigurationProducer.class)
.createConfigurationFromContext(new ConfigurationContext(psiElement));
if(context != null) {
ProgramRunnerUtil.executeConfiguration(
psiElement.getProject(),
context.getConfigurationSettings(),
DefaultDebugExecutor.getDebugExecutorInstance()
);
}
}
示例4: doDeploy
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
public void doDeploy(Executor executor) {
DeploymentTask<?> deploymentTask = getDeployment().getDeploymentTask();
if (deploymentTask != null) {
ExecutionEnvironment environment = ((DeploymentTaskImpl)deploymentTask).getExecutionEnvironment();
RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings();
if (settings != null) {
ProgramRunnerUtil.executeConfiguration(doGetProject(), settings, executor);
}
}
}
示例5: handleDoubleClickOrEnter
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
final Project project = getExternalProjectsView().getProject();
ProgramRunnerUtil.executeConfiguration(project, mySettings, DefaultRunExecutor.getRunExecutorInstance());
final RunManagerEx runManagerEx = RunManagerEx.getInstanceEx(project);
runManagerEx.setSelectedConfiguration(mySettings);
}
示例6: executeTests
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
@Override
protected void executeTests(@NotNull final Project project,
@NotNull final VirtualFile virtualFile,
@NotNull final VirtualFile taskDir,
@NotNull final VirtualFile testFile) {
final ConfigurationFactory factory = PythonConfigurationType.getInstance().getConfigurationFactories()[0];
final RunnerAndConfigurationSettings settings =
RunManager.getInstance(project).createRunConfiguration("test", factory);
final PythonRunConfiguration configuration = (PythonRunConfiguration)settings.getConfiguration();
configuration.setScriptName(testFile.getPath());
configuration.setWorkingDirectory(taskDir.getPath());
String taskFileName = CCProjectService.getRealTaskFileName(virtualFile.getName());
if (taskFileName == null) {
return;
}
VirtualFile userFile = taskDir.findChild(taskFileName);
if (userFile == null) {
return;
}
VirtualFile ideaDir = project.getBaseDir().findChild(".idea");
if (ideaDir == null) {
return;
}
VirtualFileManager.getInstance().refreshWithoutFileWatcher(true);
ProjectView.getInstance(project).refresh();
configuration.setScriptParameters(PathUtil.toSystemDependentName(project.getBasePath()) + " " + PathUtil.toSystemDependentName(userFile.getPath()));
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
ProgramRunnerUtil.executeConfiguration(project, settings, executor);
}
示例7: actionPerformed
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
final Project project = e.getRequiredData(CommonDataKeys.PROJECT);
RunnerAndConfigurationSettings configurationToRun = getConfigurationToRun(project);
if (configurationToRun != null) {
ProgramRunnerUtil.executeConfiguration(project, configurationToRun, DefaultRunExecutor.getRunExecutorInstance());
}
else {
AppEngineCloudType serverType = AppEngineCloudType.getInstance();
List<RemoteServer<AppEngineServerConfiguration>> servers = RemoteServersManager.getInstance().getServers(serverType);
DeploymentConfigurationManager.getInstance(project).createAndRunConfiguration(serverType, ContainerUtil.getFirstItem(servers));
}
}
示例8: runWithConfiguration
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
@NotNull
protected OSProcessHandler runWithConfiguration(RunConfiguration configuration) throws ExecutionException {
final PantsJUnitRunnerAndConfigurationSettings runnerAndConfigurationSettings =
new PantsJUnitRunnerAndConfigurationSettings(configuration);
final ExecutionEnvironmentBuilder environmentBuilder =
ExecutionUtil.createEnvironment(DefaultRunExecutor.getRunExecutorInstance(), runnerAndConfigurationSettings);
final ExecutionEnvironment environment = environmentBuilder.build();
ProgramRunnerUtil.executeConfiguration(environment, false, false);
final OSProcessHandler handler = (OSProcessHandler) environment.getContentToReuse().getProcessHandler();
assertTrue(handler.waitFor());
return handler;
}
示例9: actionPerformed
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
public void actionPerformed(@NotNull AnActionEvent e) {
ProgramRunnerUtil.executeConfiguration(getProject(e), myConfigurationSettings, DefaultRunExecutor.getRunExecutorInstance());
}
示例10: handleDoubleClickOrEnter
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
ProgramRunnerUtil.executeConfiguration(myProject, mySettings, DefaultRunExecutor.getRunExecutorInstance());
}
示例11: runExistingConfiguration
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
private void runExistingConfiguration(Project project, RunnerAndConfigurationSettings settings) {
ProgramRunnerUtil.executeConfiguration(
project, settings, DefaultDebugExecutor.getDebugExecutorInstance());
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:5,代码来源:CloudToolsRunConfigurationAction.java
示例12: actionPerformed
import com.intellij.execution.ProgramRunnerUtil; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent event) {
if (!myEnabled) return;
ProgramRunnerUtil.executeConfiguration(myProject, mySettings, myExecutor);
}