本文整理汇总了Java中com.intellij.execution.RunManagerEx.addConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java RunManagerEx.addConfiguration方法的具体用法?Java RunManagerEx.addConfiguration怎么用?Java RunManagerEx.addConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.RunManagerEx
的用法示例。
在下文中一共展示了RunManagerEx.addConfiguration方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testReusingConfiguration
import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
public void testReusingConfiguration() {
RunManagerEx runManager = RunManagerEx.getInstanceEx(myProject);
PsiClass psiClass = findClass(getModule1(), CLASS_NAME);
PsiPackage psiPackage = JUnitUtil.getContainingPackage(psiClass);
ConfigurationContext context = createContext(psiClass);
assertEquals(null, context.findExisting());
RunnerAndConfigurationSettings testClass = context.getConfiguration();
runManager.addConfiguration(testClass, false);
context = createContext(psiClass);
assertSame(testClass, context.findExisting());
runManager.setSelectedConfiguration(testClass);
context = createContext(psiPackage);
assertEquals(null, context.findExisting());
RunnerAndConfigurationSettings testPackage = context.getConfiguration();
runManager.addConfiguration(testPackage, false);
context = createContext(psiPackage);
assertSame(testPackage, context.findExisting());
assertSame(testClass, runManager.getSelectedConfiguration());
runManager.setSelectedConfiguration(context.findExisting());
assertSame(testPackage, runManager.getSelectedConfiguration());
}
示例2: 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());
}
}
示例3: 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);
}
示例4: 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();
}
示例5: 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();
}
}
});
}
}
示例6: 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;
}