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


Java ProgramRunnerUtil类代码示例

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


ProgramRunnerUtil类属于com.intellij.execution包,在下文中一共展示了ProgramRunnerUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DeploymentConfigurationManagerImpl.java

示例2: update

import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
protected void update(PresentationData presentation) {
  super.update(presentation);
  presentation.setIcon(ProgramRunnerUtil.getConfigurationIcon(mySettings, false));

  final ExternalSystemRunConfiguration runConfiguration = (ExternalSystemRunConfiguration)mySettings.getConfiguration();
  final ExternalSystemTaskExecutionSettings taskExecutionSettings = runConfiguration.getSettings();
  final String shortcutHint = StringUtil.nullize(getShortcutsManager().getDescription(
    taskExecutionSettings.getExternalProjectPath(), mySettings.getName()));
  final String activatorHint = StringUtil.nullize(getTaskActivator().getDescription(
    taskExecutionSettings.getExternalSystemId(), taskExecutionSettings.getExternalProjectPath(),
    getRunConfigurationActivationTaskName(mySettings)));

  String hint;
  if (shortcutHint == null) {
    hint = activatorHint;
  }
  else if (activatorHint == null) {
    hint = shortcutHint;
  }
  else {
    hint = shortcutHint + ", " + activatorHint;
  }

  setNameAndTooltip(getName(), StringUtil.join(taskExecutionSettings.getTaskNames(), " "), hint);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:RunConfigurationNode.java

示例3: 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());
}
 
开发者ID:AlexeyDmitriev,项目名称:JHelper,代码行数:30,代码来源:TaskRunner.java

示例4: processTerminated

import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
public void processTerminated( ProcessEvent event )
{
    super.processTerminated( event );
    int exitCode = event.getExitCode();

    if( exitCode == EQUINOX_RESTART_EXIT_CODE )
    {
        ApplicationManager.getApplication().runReadAction( new Runnable()
        {
            @Override
            public void run()
            {
                ProgramRunnerUtil.executeConfiguration( appModule.getProject(),
                    environment.getRunnerAndConfigurationSettings(), executor );
            }
        } );

    }
}
 
开发者ID:mcmil,项目名称:wuff-intellij-plugin,代码行数:21,代码来源:EquinoxRestartProcessListener.java

示例5: 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()
        );
    }
}
 
开发者ID:Haehnchen,项目名称:idea-php-behat-plugin,代码行数:18,代码来源:BehatPluginUtil.java

示例6: 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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ServersTreeStructure.java

示例7: 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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:RunConfigurationNode.java

示例8: suggestRunActionName

import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
public static String suggestRunActionName(final LocatableConfiguration configuration) {
  if (configuration instanceof LocatableConfigurationBase && configuration.isGeneratedName()) {
    String actionName = ((LocatableConfigurationBase)configuration).getActionName();
    if (actionName != null) {
      return actionName;
    }
  }
  return ProgramRunnerUtil.shortenName(configuration.getName(), 0);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:BaseRunConfigurationAction.java

示例9: 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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:PyCCRunTestsAction.java

示例10: 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));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:UploadApplicationAction.java

示例11: 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;
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:14,代码来源:PantsIntegrationTestCase.java

示例12: actionPerformed

import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
public void actionPerformed(@NotNull AnActionEvent e) {
  ProgramRunnerUtil.executeConfiguration(getProject(e), myConfigurationSettings, DefaultRunExecutor.getRunExecutorInstance());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ExternalSystemKeymapExtension.java

示例13: RunConfigurationNode

import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
public RunConfigurationNode(RunConfigurationsNode parent, RunnerAndConfigurationSettings settings) {
  super(parent);
  mySettings = settings;
  setUniformIcon(ProgramRunnerUtil.getConfigurationIcon(settings, false));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:MavenProjectsStructure.java

示例14: handleDoubleClickOrEnter

import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
  ProgramRunnerUtil.executeConfiguration(myProject, mySettings, DefaultRunExecutor.getRunExecutorInstance());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:MavenProjectsStructure.java

示例15: onBreakpointListChanged

import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
public void onBreakpointListChanged(final CloudDebugProcessState state) {
  SwingUtilities.invokeLater(
      new Runnable() {
        @Override
        public void run() {
          NotificationGroup notificationGroup =
              NotificationGroup.balloonGroup("Cloud Debugger watcher");
          String message =
              GctBundle.getString(
                  "clouddebug.balloonnotification.message", state.getProjectName());
          UsageTrackerProvider.getInstance()
              .trackEvent(GctTracking.CLOUD_DEBUGGER_NOTIFY_BREAKPOINT_LIST_CHANGE)
              .ping();
          notificationGroup
              .createNotification(
                  "",
                  message,
                  NotificationType.INFORMATION,
                  new NotificationListener() {
                    @Override
                    public void hyperlinkUpdate(
                        @NotNull Notification notification, @NotNull HyperlinkEvent event) {
                      notification.expire();
                      RunnerAndConfigurationSettings targetConfig = null;
                      RunManager manager = RunManager.getInstance(state.getProject());
                      for (final RunnerAndConfigurationSettings config :
                          manager.getAllSettings()) {
                        if (config.getConfiguration() instanceof CloudDebugRunConfiguration
                            && ((CloudDebugRunConfiguration) config.getConfiguration())
                                    .getProcessState()
                                == state) {
                          targetConfig = config;
                        }
                      }

                      if (targetConfig != null) {
                        Executor executor = DefaultDebugExecutor.getDebugExecutorInstance();
                        ProgramRunnerUtil.executeConfiguration(
                            state.getProject(), targetConfig, executor);
                      }
                    }
                  })
              .notify(state.getProject());
        }
      });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:48,代码来源:CloudDebugProcessWatcher.java


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