Java Code Examples for com.intellij.execution.RunManager#getSelectedConfiguration()
The following examples show how to use
com.intellij.execution.RunManager#getSelectedConfiguration() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlazeRunConfigurationSyncListener.java From intellij with Apache License 2.0 | 6 votes |
/** * Adds a run configuration for an android_binary target if there is not already a configuration * for that target. */ private static void maybeAddRunConfiguration( Project project, BlazeProjectData blazeProjectData, Label label) { RunManager runManager = RunManager.getInstance(project); for (BlazeRunConfigurationFactory configurationFactory : BlazeRunConfigurationFactory.EP_NAME.getExtensions()) { if (configurationFactory.handlesTarget(project, blazeProjectData, label)) { final RunnerAndConfigurationSettings settings = configurationFactory.createForTarget(project, runManager, label); runManager.addConfiguration(settings, /* isShared= */ false); if (runManager.getSelectedConfiguration() == null) { runManager.setSelectedConfiguration(settings); } break; } } }
Example 2
Source File: FlutterModuleUtils.java From flutter-intellij with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Ensures a Flutter run configuration is selected in the run pull down. */ public static void ensureRunConfigSelected(@NotNull Project project) { if (project.isDisposed()) return; final FlutterRunConfigurationType configType = FlutterRunConfigurationType.getInstance(); final RunManager runManager = RunManager.getInstance(project); if (!runManager.getConfigurationsList(configType).isEmpty()) { if (runManager.getSelectedConfiguration() == null) { final List<RunnerAndConfigurationSettings> flutterConfigs = runManager.getConfigurationSettingsList(configType); if (!flutterConfigs.isEmpty()) { runManager.setSelectedConfiguration(flutterConfigs.get(0)); } } } }
Example 3
Source File: FlutterModuleUtils.java From flutter-intellij with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Ensures a Flutter run configuration is selected in the run pull down. */ public static void ensureRunConfigSelected(@NotNull Project project) { if (project.isDisposed()) return; final FlutterRunConfigurationType configType = FlutterRunConfigurationType.getInstance(); final RunManager runManager = RunManager.getInstance(project); if (!runManager.getConfigurationsList(configType).isEmpty()) { if (runManager.getSelectedConfiguration() == null) { final List<RunnerAndConfigurationSettings> flutterConfigs = runManager.getConfigurationSettingsList(configType); if (!flutterConfigs.isEmpty()) { runManager.setSelectedConfiguration(flutterConfigs.get(0)); } } } }
Example 4
Source File: RunProject.java From tmc-intellij with MIT License | 5 votes |
private boolean makeSureConfigurationIsCorrectType(RunManager runManager) { if (runManager.getSelectedConfiguration() == null || factory.checkConfigurationType()) { logger.info("Prompting user to choose main class with Chooser."); TreeClassChooser chooser = factory.chooseMainClassForProject(); if (chooser.getSelected() == null) { logger.warn("Choosing main class returned null and running is cancelled."); return true; } logger.info("Creating configurations."); factory.createConfiguration(); factory.configApplicationConfiguration(chooser); } return false; }
Example 5
Source File: CreateAction.java From consulo with Apache License 2.0 | 5 votes |
private static BaseCreatePolicy choosePolicy(final ConfigurationContext context) { final RunnerAndConfigurationSettings configuration = context.findExisting(); if (configuration == null) return CREATE_AND_EDIT; final RunManager runManager = context.getRunManager(); if (runManager.getSelectedConfiguration() != configuration) return SELECT; if (configuration.isTemporary()) return SAVE; return SELECTED_STABLE; }