Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
if (editor == null) {
return;
}
DataContext dataContext = createDataContext(editor, element);
RunConfigurationProducer jstdOriginalProducer = getJstdRunConfigurationProducer();
if (jstdOriginalProducer == null) {
return;
}
ConfigurationContext context = ConfigurationContext.getFromContext(dataContext);
boolean created = false;
RunnerAndConfigurationSettings configuration = jstdOriginalProducer.findExistingConfiguration(context);
if (configuration == null) {
created = true;
ConfigurationFromContext fromContext = jstdOriginalProducer.createConfigurationFromContext(context);
if (fromContext != null) {
configuration = fromContext.getConfigurationSettings();
}
else {
return;