• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ProgramRunnerUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ProgramRunnerUtil类属于com.intellij.execution包,在下文中一共展示了ProgramRunnerUtil类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: 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


示例17: actionPerformed

import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent event) {
	if (!myEnabled) return;

	ProgramRunnerUtil.executeConfiguration(myProject, mySettings, myExecutor);
}
 
开发者ID:krasa,项目名称:MavenHelper,代码行数:7,代码来源:RunConfigurationAction.java


示例18: attachDebugger

import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
public static void attachDebugger(final String packageName, final Project project)
    throws InterruptedException {
  IDevice[] devices = AndroidDebugBridge.getBridge().getDevices();
  if (devices.length == 0) {
    return;
  }
  IDevice device = devices[0];

  Client client;
  int currentRetryNumber = 0;
  int currentRetryTime = RETRY_TIME;
  // It takes some time to get the updated client process list, so wait for it
  do {
    client = device.getClient(packageName);
    currentRetryTime *= 2;
    Thread.sleep(currentRetryTime);
    currentRetryNumber++;
  } while (client == null && currentRetryNumber < MAX_RETRIES);

  if (client == null) {
    throw new RuntimeException(
        "Connecting to the adb debug server timed out."
            + "Can't find package with name "
            + packageName
            + ".");
  }

  String debugPort = String.valueOf(client.getDebuggerListenPort());
  final RunnerAndConfigurationSettings settings = createRunConfiguration(project, debugPort);

  ApplicationManager.getApplication()
      .invokeLater(
          new Runnable() {
            @Override
            public void run() {
              // Needs read access which is available on the read thread.
              ProgramRunnerUtil.executeConfiguration(
                  project, settings, DefaultDebugExecutor.getDebugExecutorInstance());
            }
          });
}
 
开发者ID:facebook,项目名称:buck,代码行数:42,代码来源:AndroidDebugger.java


示例19: suggestedName

import com.intellij.execution.ProgramRunnerUtil; //导入依赖的package包/类
@Override
public String suggestedName()
{
	return ProgramRunnerUtil.shortenName(JavaExecutionUtil.getShortClassName(MAIN_CLASS_NAME), 0);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:6,代码来源:AppletConfiguration.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NodeFinder类代码示例发布时间:2022-05-22
下一篇:
Java DNSRecordClass类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap