TableCellEditor (Item pair) { ExtendableTextField cellEditor = new ExtendableTextField(); cellEditor.putClientProperty(DarculaUIUtil.COMPACT_PROPERTY, Boolean.TRUE); new ComponentValidator(validatorsDisposable).withValidator(() -> { String text = cellEditor.getText(); boolean hasError = !StringUtil.isEmpty(text) && !ourPackagePattern.matcher(text).matches(); ValidationUtils.setExtension(cellEditor, ValidationUtils.ERROR_EXTENSION, hasError); return validationInfoProducer.apply(text, cellEditor); }).andRegisterOnDocumentListener(cellEditor).installOn(cellEditor); return new DefaultCellEditor(cellEditor); }