use of com.intellij.execution.actions.ConfigurationContext in project intellij-plugins by JetBrains.
the class CfmlRunConfigurationTest method getContextRunConfiguration.
private static CfmlRunConfiguration getContextRunConfiguration(Editor editor) {
final DataContext dataContext = DataManager.getInstance().getDataContext(editor.getComponent());
final ConfigurationContext configurationContext = ConfigurationContext.getFromContext(dataContext);
//this block emulates RunContextAction.perform()
RunnerAndConfigurationSettings configuration = configurationContext.findExisting();
if (configuration == null) {
configuration = configurationContext.getConfiguration();
if (configuration == null) {
return null;
}
((RunManagerEx) configurationContext.getRunManager()).setTemporaryConfiguration(configuration);
}
//end of the emulated block
return (CfmlRunConfiguration) configuration.getConfiguration();
}
Aggregations