}
@Override
@NotNull
protected Configuration lookupConfiguration() {
ConfigurationTemplate resourceConfigTemplate;
// If the input is not present, nullify the previous selected template name if it was set
if (selectedTemplateNameInput != null) {
selectedTemplateName = (String) selectedTemplateNameInput.getValue();
} else {
selectedTemplateName = null;
}
if ((this.selectedTemplateName != null) && !selectedTemplateName.equals("")) {
resourceConfigTemplate = getConfigurationDefinition().getTemplate(this.selectedTemplateName);
if (resourceConfigTemplate == null) {
throw new IllegalStateException("A template named '" + this.selectedTemplateName
+ "' does not exist for " + getResourceType() + " resource configurations.");
}
} else {
resourceConfigTemplate = getConfigurationDefinition().getDefaultTemplate();
}
Configuration resourceConfig = (resourceConfigTemplate != null) ? resourceConfigTemplate.createConfiguration()
: new Configuration();
ConfigurationUtility.normalizeConfiguration(resourceConfig, getConfigurationDefinition());
return resourceConfig;
}