@Override
  public void apply() throws ConfigurationException {
    final CompilerProjectExtension compilerProjectExtension = CompilerProjectExtension.getInstance(myProject);
    assert compilerProjectExtension != null : myProject;

    final String myProjectName = myUi.getProjectName();
    if (StringUtil.isEmptyOrSpaces(myProjectName)) {
      throw new ConfigurationException(JavaUiBundle.message("project.configurable.dialog.message"));
    }

    ApplicationManager.getApplication().runWriteAction(() -> {
      // set the output path first so that handlers of RootsChanged event sent after JDK is set
      // would see the updated path
      String canonicalPath = myUi.getProjectCompilerOutput();
      if (canonicalPath.length() > 0) {
        try {
          canonicalPath = FileUtil.resolveShortWindowsName(canonicalPath);
        }
        catch (IOException e) {
          //file doesn't exist yet
        }
        canonicalPath = FileUtil.toSystemIndependentName(canonicalPath);
        compilerProjectExtension.setCompilerOutputUrl(VfsUtilCore.pathToUrl(canonicalPath));
      }
      else {
        compilerProjectExtension.setCompilerOutputPointer(null);
      }

      LanguageLevelProjectExtension extension = LanguageLevelProjectExtension.getInstance(myProject);
      LanguageLevel level = myUi.getLanguageLevel();
      if (level != null) {
        extension.setLanguageLevel(level);
      }
      extension.setDefault(myUi.isDefaultLanguageLevel());
      myUi.applyProjectJdkConfigurable();

      if (myProject instanceof ProjectEx) {
        ((ProjectEx)myProject).setProjectName(getProjectName());
        if (myDetailsComponent != null) myDetailsComponent.setText(getBannerSlogan());
      }
    });
  }
@Override
  public void apply()