void (@NotNull RunnerAndConfigurationSettings settings, boolean checkPathValidity) { switch (myRCStorageType) { case Workspace -> settings.storeInLocalWorkspace(); case DotIdeaFolder -> settings.storeInDotIdeaFolder(); case ArbitraryFileInProject -> { if (checkPathValidity && getErrorIfBadFolderPathForStoringInArbitraryFile(myProject, myFolderPathIfStoredInArbitraryFile) != null) { // don't apply incorrect UI to the model } else { // not sure the 'Template' prefix of the 'Template XXX.run.xml' file name should be localized. String name = settings.isTemplate() ? "Template " + settings.getType().getDisplayName() : settings.getName(); String fileName = getFileNameByRCName(name); settings.storeInArbitraryFileInProject(myFolderPathIfStoredInArbitraryFile + "/" + fileName); } } default -> throw new IllegalStateException("Unexpected value: " + myRCStorageType); } }