@Override
  public boolean checkInput(String inputString) {
    if (inputString.isEmpty() || inputString.equals(myInitialText)) {
      errorText = null;
      return true;
    }

    if (inputString.endsWith(DELIMITER)) {
      errorText = IdeBundle.message("error.invalid.java.package.name.format");
      return false;
    }

    final PsiDirectoryFactory nameValidator = PsiDirectoryFactory.getInstance(myProject);
    VirtualFile file = myPackageRoot.getVirtualFile();
    errorText = null;

    for (String token : inputString.split(REGEX_DELIMITER)) {
      if (token.isEmpty()) {
        errorText = IdeBundle.message("error.invalid.java.package.name.format");
        return false;
      }

      if (file != null) {
        file = file.findChild(token);
        if (file != null && !file.isDirectory()) {
          errorText = IdeBundle.message("error.file.with.name.already.exists", token);
          return false;
        }
      }

      if (!nameValidator.isValidPackageName(token)) {
        errorText = IdeBundle.message("error.invalid.java.package.name");
      }

      if (FileTypeManager.getInstance().isFileIgnored(token)) {
        errorText = IdeBundle.message("warning.create.package.with.ignored.name", token);
      }
    }

    if (file != null) {
      errorText = IdeBundle.message("error.package.with.name.already.exists", file.getName());
      return false;
    }

    return true;
  }
@Override
  public boolean checkInput(String inputString)