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


Java RunManagerEx.createRunConfiguration方法代码示例

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


在下文中一共展示了RunManagerEx.createRunConfiguration方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createAndRunConfiguration

import com.intellij.execution.RunManagerEx; //导入方法依赖的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: ensureRunConfigurationExists

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
protected static void ensureRunConfigurationExists(Module module, ConfigurationType configurationType, String name) {
  final RunManagerEx runManager = RunManagerEx.getInstanceEx(module.getProject());
  for (final RunConfiguration runConfiguration : runManager.getConfigurations(configurationType)) {
    if (runConfiguration instanceof MvcRunConfiguration && ((MvcRunConfiguration)runConfiguration).getModule() == module) {
      return;
    }
  }

  final ConfigurationFactory factory = configurationType.getConfigurationFactories()[0];
  final RunnerAndConfigurationSettings runSettings = runManager.createRunConfiguration(name,
                                                                                                                               factory);
  final MvcRunConfiguration configuration = (MvcRunConfiguration)runSettings.getConfiguration();
  configuration.setModule(module);
  runManager.addConfiguration(runSettings, false);
  runManager.setActiveConfiguration(runSettings);

  RunManagerEx.disableTasks(module.getProject(), configuration, CompileStepBeforeRun.ID, CompileStepBeforeRunNoErrorCheck.ID);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:MvcFramework.java

示例3: createConfiguration

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
private static TestNGConfiguration createConfiguration(final Project project) {
  final RunManagerEx manager = RunManagerEx.getInstanceEx(project);
  final RunnerAndConfigurationSettings settings =
    manager.createRunConfiguration("testt", TestNGConfigurationType.getInstance().getConfigurationFactories()[0]);
  manager.addConfiguration(settings, false);
  return (TestNGConfiguration)settings.getConfiguration();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ConfigurationsTest.java

示例4: addRunConfiguration

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
public static void addRunConfiguration(@NotNull final CordovaFacet facet, @Nullable final String activityClass, final boolean ask,
                                       @Nullable final TargetSelectionMode targetSelectionMode,
                                       @Nullable final String preferredAvdName) {
    final Module module = facet.getModule();
    final Project project = module.getProject();

    final Runnable r = new Runnable() {
        @Override
        public void run() {
            final RunManagerEx runManager = RunManagerEx.getInstanceEx(project);
            final RunnerAndConfigurationSettings settings = runManager.
                    createRunConfiguration(module.getName(), CordovaRunConfigurationType.getInstance().getFactory());
            final CordovaRunConfiguration configuration = (CordovaRunConfiguration) settings.getConfiguration();
            configuration.setModule(module);

            if (activityClass != null) {
                configuration.MODE = CordovaRunConfiguration.LAUNCH_SPECIFIC_ACTIVITY;
                configuration.ACTIVITY_CLASS = activityClass;
            } else {
                configuration.MODE = CordovaRunConfiguration.LAUNCH_DEFAULT_ACTIVITY;
            }

            if (targetSelectionMode != null) {
                configuration.setTargetSelectionMode(targetSelectionMode);
            }
            if (preferredAvdName != null) {
                configuration.PREFERRED_AVD = preferredAvdName;
            }
            runManager.addConfiguration(settings, false);
            runManager.setActiveConfiguration(settings);
        }
    };
    if (!ask) {
        r.run();
    } else {
        UIUtil.invokeLaterIfNeeded(new Runnable() {
            @Override
            public void run() {
                final String moduleName = facet.getModule().getName();
                final int result = Messages.showYesNoDialog(project, "Do you want to create run configuration for module " + moduleName + "?",
                        "Create Run Configuration", Messages.getQuestionIcon());
                if (result == Messages.YES) {
                    r.run();
                }
            }
        });
    }
}
 
开发者ID:chrimm,项目名称:cordovastudio,代码行数:49,代码来源:CordovaStudioUtils.java

示例5: createRunConfiguration

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
public static <SC extends ServerConfiguration, DC extends DeploymentConfiguration>
DeployToServerRunConfiguration<SC, DC> createRunConfiguration(RemoteServer<SC> account,
                                                              Module module,
                                                              DeploymentSource deploymentSource,
                                                              DC deploymentConfiguration) {
  Project project = module.getProject();

  String accountName = account.getName();

  String name = generateRunConfigurationName(accountName, module.getName());

  final RunManagerEx runManager = RunManagerEx.getInstanceEx(project);
  ConfigurationFactory configurationFactory = getRunConfigurationType(account.getType()).getConfigurationFactories()[0];
  final RunnerAndConfigurationSettings runSettings = runManager.createRunConfiguration(name, configurationFactory);

  final DeployToServerRunConfiguration<SC, DC> result = (DeployToServerRunConfiguration<SC, DC>)runSettings.getConfiguration();

  result.setServerName(accountName);

  result.setDeploymentSource(deploymentSource);

  result.setDeploymentConfiguration(deploymentConfiguration);

  ((ConfigurationFactoryEx)configurationFactory).onNewConfigurationCreated(runSettings.getConfiguration());

  runManager.addConfiguration(runSettings, false);
  runManager.setSelectedConfiguration(runSettings);

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:CloudRunConfigurationUtil.java


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