本文整理汇总了Java中com.intellij.execution.impl.RunManagerImpl.addConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java RunManagerImpl.addConfiguration方法的具体用法?Java RunManagerImpl.addConfiguration怎么用?Java RunManagerImpl.addConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.impl.RunManagerImpl
的用法示例。
在下文中一共展示了RunManagerImpl.addConfiguration方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addConfigurations
import com.intellij.execution.impl.RunManagerImpl; //导入方法依赖的package包/类
private void addConfigurations() {
RunManagerImpl runManager = (RunManagerImpl) RunManagerEx.getInstanceEx(project);
BlazeCommandRunConfigurationType.BlazeCommandRunConfigurationFactory configurationFactory =
BlazeCommandRunConfigurationType.getInstance().getFactory();
BlazeCommandRunConfiguration blazeAndroidBinaryConfiguration =
configurationFactory.createTemplateConfiguration(project);
blazeAndroidBinaryConfiguration.setName("AndroidBinaryConfiguration");
blazeAndroidBinaryConfiguration.setTarget(Label.create("//label:android_binary_rule"));
BlazeCommandRunConfiguration blazeAndroidTestConfiguration =
configurationFactory.createTemplateConfiguration(project);
blazeAndroidTestConfiguration.setName("AndroidTestConfiguration");
blazeAndroidTestConfiguration.setTarget(Label.create("//label:android_test_rule"));
runManager.addConfiguration(
runManager.createConfiguration(blazeAndroidBinaryConfiguration, configurationFactory),
true);
runManager.addConfiguration(
runManager.createConfiguration(blazeAndroidTestConfiguration, configurationFactory), true);
}
示例2: setupRootModel
import com.intellij.execution.impl.RunManagerImpl; //导入方法依赖的package包/类
@Override
public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
setJavaRootModel(rootModel);
Project project = rootModel.getProject();
RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(project);
//Create "Run dub" configuration
RunnerAndConfigurationSettings runDubSettings = runManager.findConfigurationByName(RUN_DUB_CONFIG_NAME);
if(runDubSettings == null) {
final DLangRunDubConfigurationType configurationType
= Extensions.findExtension(ConfigurationType.CONFIGURATION_TYPE_EP, DLangRunDubConfigurationType.class);
final ConfigurationFactory factory = configurationType.getConfigurationFactories()[0];
runDubSettings = runManager.createRunConfiguration(RUN_DUB_CONFIG_NAME, factory);
((ModuleBasedConfiguration) runDubSettings.getConfiguration()).setModule(rootModel.getModule());
runManager.addConfiguration(runDubSettings, false);
}
}
示例3: createNewConfiguration
import com.intellij.execution.impl.RunManagerImpl; //导入方法依赖的package包/类
private void createNewConfiguration(Project project) {
final RunManagerImpl manager = RunManagerImpl.getInstanceImpl(project);
final ConfigurationFactory factory =
configType != null ? configType.getConfigurationFactories()[0] : null;
EditConfigurationsDialog dialog = new EditConfigurationsDialog(project, factory);
if (dialog.showAndGet()) {
RunnerAndConfigurationSettings settings = manager.getSelectedConfiguration();
if (settings != null) {
manager.addConfiguration(settings, false /*isShared*/);
}
}
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:17,代码来源:CloudToolsRunConfigurationAction.java
示例4: assertAndRunPantsMake
import com.intellij.execution.impl.RunManagerImpl; //导入方法依赖的package包/类
protected void assertAndRunPantsMake(JUnitConfiguration runConfiguration) {
RunManager runManager = RunManager.getInstance(myProject);
assertTrue(runManager instanceof RunManagerImpl);
RunManagerImpl runManagerImpl = (RunManagerImpl) runManager;
RunnerAndConfigurationSettings runnerAndConfigurationSettings =
runManagerImpl.createConfiguration(runConfiguration, JUnitConfigurationType.getInstance().getConfigurationFactories()[0]);
runManagerImpl.addConfiguration(runnerAndConfigurationSettings, false);
// Make sure PantsMake is the one and only task before JUnit run.
List<BeforeRunTask<?>> beforeRunTaskList = runManagerImpl.getBeforeRunTasks(runConfiguration);
assertEquals(1, beforeRunTaskList.size());
BeforeRunTask task = beforeRunTaskList.iterator().next();
assertEquals(PantsMakeBeforeRun.ID, task.getProviderId());
/*
* Manually invoke BeforeRunTask as {@link ExecutionManager#compileAndRun} launches another task asynchronously,
* and there is no way to catch that.
*/
BeforeRunTaskProvider provider = BeforeRunTaskProvider.getProvider(myProject, task.getProviderId());
assertNotNull(String.format("Cannot find BeforeRunTaskProvider for id='%s'", task.getProviderId()), provider);
assertTrue(provider.executeTask(null, runConfiguration, null, task));
}
示例5: perform
import com.intellij.execution.impl.RunManagerImpl; //导入方法依赖的package包/类
@Override
public void perform(final ConfigurationContext context) {
final RunManagerImpl runManager = (RunManagerImpl)context.getRunManager();
final RunnerAndConfigurationSettings configuration = context.getConfiguration();
final RunnerAndConfigurationSettings template = runManager.getConfigurationTemplate(configuration.getFactory());
final RunConfiguration templateConfiguration = template.getConfiguration();
runManager.addConfiguration(configuration,
runManager.isConfigurationShared(template),
runManager.getBeforeRunTasks(templateConfiguration),
false);
runManager.setSelectedConfiguration(configuration);
}
示例6: actionPerformed
import com.intellij.execution.impl.RunManagerImpl; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final AntBuildFile buildFile = getCurrentBuildFile();
if (buildFile == null || !buildFile.exists()) {
return;
}
TreePath selectionPath = myTree.getSelectionPath();
if (selectionPath == null) return;
final DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectionPath.getLastPathComponent();
final Object userObject = node.getUserObject();
AntBuildTarget target = null;
if (userObject instanceof AntTargetNodeDescriptor) {
AntTargetNodeDescriptor targetNodeDescriptor = (AntTargetNodeDescriptor)userObject;
target = targetNodeDescriptor.getTarget();
}
else if (userObject instanceof AntBuildFileNodeDescriptor){
AntBuildModel model = ((AntBuildFileNodeDescriptor)userObject).getBuildFile().getModel();
target = model.findTarget(model.getDefaultTargetName());
}
String name = target != null ? target.getDisplayName() : null;
if (target == null || name == null) {
return;
}
RunManagerImpl runManager = (RunManagerImpl)RunManager.getInstance(e.getProject());
RunnerAndConfigurationSettings settings =
runManager.createRunConfiguration(name, AntRunConfigurationType.getInstance().getFactory());
AntRunConfiguration configuration = (AntRunConfiguration)settings.getConfiguration();
configuration.acceptSettings(target);
if (RunDialog.editConfiguration(e.getProject(), settings, ExecutionBundle
.message("create.run.configuration.for.item.dialog.title", configuration.getName()))) {
runManager.addConfiguration(settings,
runManager.isConfigurationShared(settings),
runManager.getBeforeRunTasks(settings.getConfiguration()), false);
runManager.setSelectedConfiguration(settings);
}
}
示例7: getBeforeRunTask
import com.intellij.execution.impl.RunManagerImpl; //导入方法依赖的package包/类
private List<BeforeRunTask<?>> getBeforeRunTask(RunConfiguration configuration) {
RunManagerImpl runManager = (RunManagerImpl) RunManager.getInstance(myProject);
RunnerAndConfigurationSettingsImpl configurationSettings = new RunnerAndConfigurationSettingsImpl(runManager, configuration, true);
runManager.addConfiguration(configurationSettings, true);
List<BeforeRunTask<?>> tasks = runManager.getBeforeRunTasks(configuration);
runManager.removeConfiguration(configurationSettings);
return tasks;
}
示例8: perform
import com.intellij.execution.impl.RunManagerImpl; //导入方法依赖的package包/类
@Override
public void perform(final ConfigurationContext context) {
final RunManagerImpl runManager = (RunManagerImpl)context.getRunManager();
final RunnerAndConfigurationSettings configuration = context.getConfiguration();
final RunnerAndConfigurationSettings template = runManager.getConfigurationTemplate(configuration.getFactory());
final RunConfiguration templateConfiguration = template.getConfiguration();
runManager.addConfiguration(configuration,
runManager.isConfigurationShared(template),
runManager.getBeforeRunTasks(templateConfiguration),
false);
runManager.setActiveConfiguration(configuration);
}