@Override
      public void textChanged(@NotNull DocumentEvent event) {
        final String text = nameField.getText();
        validator.checkInput(text);
        String errorText = validator.getErrorText(text);
        String warningText = validator.getWarningText(text);
        if (errorText != null) {
          contentPanel.setError(errorText);
        }
        else if (warningText != null) {
          contentPanel.setWarning(warningText);
        }
        else if (contentPanel.hasError()) {
          contentPanel.setError(null);
        }
      }
@Override
      public void textChanged(@NotNull DocumentEvent event)