use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class RecentTestsListProvider method initRunConfigurationsMap.
private void initRunConfigurationsMap() {
RunManagerEx manager = RunManagerEx.getInstanceEx(myProject);
ConfigurationType[] types = manager.getConfigurationFactories();
for (ConfigurationType type : types) {
Map<String, List<RunnerAndConfigurationSettings>> structure = manager.getStructure(type);
for (Map.Entry<String, List<RunnerAndConfigurationSettings>> e : structure.entrySet()) {
for (RunnerAndConfigurationSettings settings : e.getValue()) {
myConfigurationsMap.put(settings.getName().hashCode(), settings);
}
}
}
}
use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class AbstractExternalSystemRuntimeConfigurationProducer method createConfigurationByElement.
@Nullable
@Override
protected RunnerAndConfigurationSettings createConfigurationByElement(Location location, ConfigurationContext context) {
if (!(location instanceof ExternalSystemTaskLocation)) {
return null;
}
ExternalSystemTaskLocation taskLocation = (ExternalSystemTaskLocation) location;
mySourceElement = taskLocation.getPsiElement();
RunManagerEx runManager = RunManagerEx.getInstanceEx(taskLocation.getProject());
RunnerAndConfigurationSettings settings = runManager.createConfiguration("", getConfigurationFactory());
ExternalSystemRunConfiguration configuration = (ExternalSystemRunConfiguration) settings.getConfiguration();
ExternalSystemTaskExecutionSettings taskExecutionSettings = configuration.getSettings();
ExternalTaskExecutionInfo task = taskLocation.getTaskInfo();
taskExecutionSettings.setExternalProjectPath(task.getSettings().getExternalProjectPath());
taskExecutionSettings.setTaskNames(task.getSettings().getTaskNames());
configuration.setName(AbstractExternalSystemTaskConfigurationType.generateName(location.getProject(), taskExecutionSettings));
return settings;
}
use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class RunExternalSystemTaskAction method perform.
@Override
protected void perform(@NotNull Project project, @NotNull ProjectSystemId projectSystemId, @NotNull TaskData taskData, @NotNull AnActionEvent e) {
final ExternalTaskExecutionInfo taskExecutionInfo = ExternalSystemActionUtil.buildTaskInfo(taskData);
ExternalSystemUtil.runTask(taskExecutionInfo.getSettings(), taskExecutionInfo.getExecutorId(), project, projectSystemId);
final DataContext dataContext = e.getDataContext();
final ConfigurationContext context = ConfigurationContext.getFromContext(dataContext);
RunnerAndConfigurationSettings configuration = context.findExisting();
RunManagerEx runManager = (RunManagerEx) context.getRunManager();
if (configuration == null) {
configuration = context.getConfiguration();
if (configuration == null) {
return;
}
runManager.setTemporaryConfiguration(configuration);
}
runManager.setSelectedConfiguration(configuration);
}
use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class DeploymentConfigurationManagerImpl method createAndRunConfiguration.
@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());
}
}
use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class CloudRunConfigurationUtil method createRunConfiguration.
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;
}
Aggregations