private @NotNull ExtendableTextField createTextField(boolean liveErrorValidation) {
    ExtendableTextField res = new ExtendableTextField();

    int textFieldHeight = ExperimentalUI.isNewUI() ? 32 : 28;
    Dimension minSize = res.getMinimumSize();
    Dimension prefSize = res.getPreferredSize();
    minSize.height = JBUIScale.scale(textFieldHeight);
    prefSize.height = JBUIScale.scale(textFieldHeight);
    res.setMinimumSize(minSize);
    res.setPreferredSize(prefSize);
    res.setColumns(30);

    Border errorBorder = new ErrorBorder(res.getBorder());
    if (ExperimentalUI.isNewUI()) {
      res.setBorder(JBUI.Borders.compound(errorBorder, JBUI.Borders.emptyLeft(13)));
    } else {
      Border border = JBUI.Borders.customLine(JBUI.CurrentTheme.NewClassDialog.bordersColor(), 1, 0, 0, 0);
      res.setBorder(JBUI.Borders.compound(border, errorBorder));
    }
    res.setBackground(JBUI.CurrentTheme.NewClassDialog.searchFieldBackground());

    res.putClientProperty(TextComponentEmptyText.STATUS_VISIBLE_FUNCTION, (Predicate<JBTextField>)field -> field.getText().isEmpty());
    res.getEmptyText().setText(IdeBundle.message("action.create.new.class.name.field"));
    res.getAccessibleContext().setAccessibleName(IdeBundle.message("action.create.new.class.name.field"));
    res.addKeyListener(new KeyAdapter() {
      @Override
      public void keyPressed(KeyEvent e) {
        performApplyActionOnEnter(e);
      }
    });

    res.getDocument().addDocumentListener(new DocumentAdapter() {
      @Override
      protected void textChanged(@NotNull DocumentEvent e) {
        if (!liveErrorValidation) setError(null);
      }
    });

    return res;
  }
private @NotNull ExtendableTextField createTextField(boolean liveErrorValidation)