RunnerAndConfigurationSettings (Module module, ConfigurationFactory factory) { final Project project = module.getProject(); final RunManager runManager = RunManager.getInstance(project); final RunnerAndConfigurationSettings settings = createConfigurationSettings(factory, module); runManager.addConfiguration(settings); runManager.setSelectedConfiguration(settings); return settings; }