boolean () { myInstallFramework = false; if (!super.checkValid()) { return false; } var interpreterPanel = myInterpreterPanel; final Map<Boolean, List<String>> errorsAndWarnings = StreamEx .of(interpreterPanel == null ? Collections.emptyList() : interpreterPanel.validateAll()) .groupingBy(it -> it.warning, Collectors.mapping(it -> it.message, Collectors.toList())); List<String> validationErrors = errorsAndWarnings.getOrDefault(false, Collections.emptyList()); final List<String> validationWarnings = errorsAndWarnings.getOrDefault(true, Collections.emptyList()); if (validationErrors.isEmpty()) { // Once can't create anything on immutable SDK var sdk = (interpreterPanel != null) ? interpreterPanel.getSdk() : null; if (sdk != null && isImmutableSdk(sdk)) { validationErrors = List.of( PyBundle.message("python.unknown.project.synchronizer.this.interpreter.type.does.not.support.remote.project.creation")); } } if (!validationErrors.isEmpty()) { setErrorText(StringUtil.join(validationErrors, "\n")); return false; } else if (!validationWarnings.isEmpty()) { setWarningText(StreamEx.of(validationWarnings) .map(HtmlChunk::raw) .collect(HtmlChunk.toFragment(HtmlChunk.br())) .toString()); } final PythonProjectGenerator generator = ObjectUtils.tryCast(myProjectGenerator, PythonProjectGenerator.class); final Sdk sdk = getInterpreterPanelSdk(); if (generator == null || sdk == null) { myInstallFramework = true; return true; } try { generator.checkProjectCanBeCreatedOnSdk(sdk, new File(getProjectLocation())); } catch (final PythonProjectGenerator.PyNoProjectAllowedOnSdkException e) { setErrorText(e.getMessage()); return false; } final List<String> warnings = new ArrayList<>(validationWarnings); final PyFrameworkProjectGenerator frameworkGenerator = ObjectUtils.tryCast(myProjectGenerator, PyFrameworkProjectGenerator.class); if (frameworkGenerator != null) { final String python3Error = validateFrameworkSupportsPython3(frameworkGenerator, sdk); if (python3Error != null) { setErrorText(python3Error); return false; } // Framework package check may be heavy in case of remote sdk and should not be called on AWT, pretend everything is OK for // remote and check for packages later if (!PythonSdkUtil.isRemote(sdk)) { final Pair<Boolean, List<String>> validationInfo = validateFramework(frameworkGenerator, sdk); myInstallFramework = validationInfo.first; warnings.addAll(validationInfo.second); final ValidationResult warningResult = ((PythonProjectGenerator<?>)myProjectGenerator).warningValidation(sdk); if (!warningResult.isOk()) { warnings.add(warningResult.getErrorMessage()); } } } if (!warnings.isEmpty()) { setWarningText(StreamEx.of(warnings) .map(HtmlChunk::raw) .collect(HtmlChunk.toFragment(HtmlChunk.br())) .toString()); } return true; }