@Override
  public boolean validate() throws ConfigurationException {
    if (!super.validate()) {
      return false;
    }

    if (CREATE_SOURCE_PANEL.equals(myCurrentMode) && myRbCreateSource.isSelected()) {
      final String sourceDirectoryPath = getSourceDirectoryPath();
      final String relativePath = myTfSourceDirectoryName.getText().trim();
      if (sourceDirectoryPath != null) {
        if (relativePath.isEmpty()) {
          String text = JavaUiBundle.message("prompt.relative.path.to.sources.empty", FileUtil.toSystemDependentName(sourceDirectoryPath));
          final int answer = Messages.showYesNoCancelDialog(myTfSourceDirectoryName, text, JavaUiBundle.message("title.mark.source.directory"),
                                                            JavaUiBundle.message("action.mark"), JavaUiBundle.message("action.do.not.mark"),
                                                            CommonBundle.getCancelButtonText(), Messages.getQuestionIcon());
          if (answer == Messages.CANCEL) {
            return false; // cancel
          }
          if (answer == Messages.NO) { // don't mark
            myRbNoSource.doClick();
          }
        }
        final String contentRootPath = getContentRootPath();
        if (contentRootPath != null) {
          final File rootDir = new File(contentRootPath);
          final File srcDir = new File(sourceDirectoryPath);
          if (!FileUtil.isAncestor(rootDir, srcDir, false)) {
            Messages.showErrorDialog(myTfSourceDirectoryName,
                                     JavaUiBundle.message("error.source.directory.should.be.under.module.content.root.directory"),
                                     CommonBundle.getErrorTitle());
            return false;
          }
          try {
            VfsUtil.createDirectories(srcDir.getPath());
          }
          catch (IOException e) {
            throw new ConfigurationException(e.getMessage());
          }
        }
      }
    }
    return true;
  }
@Override
  public boolean validate()