Sdk () { if (!(myProjectGenerator instanceof PythonProjectGenerator)) return null; final PyAddSdkGroupPanel interpreterPanel = myInterpreterPanel; if (interpreterPanel == null) return null; final PyAddSdkPanel panel = interpreterPanel.getSelectedPanel(); if (panel instanceof PyAddNewEnvironmentPanel newEnvironmentPanel) { return new PyLazySdk("Uninitialized environment", newEnvironmentPanel::getOrCreateSdk); } else if (panel instanceof PyAddExistingSdkPanel) { return panel.getSdk(); } else { return null; } }