void (String pattern) { super.onSearchFieldUpdated(pattern); if (!myFilteringMode) return; RowSorter<? extends TableModel> sorter0 = myComponent.getRowSorter(); if (!(sorter0 instanceof TableRowSorter)) return; //noinspection unchecked TableRowSorter<TableModel> sorter = (TableRowSorter<TableModel>)sorter0; if (StringUtil.isNotEmpty(pattern)) { if (sorter.getRowFilter() == null) { UIUtil.putClientProperty(myComponent, SELECTION_BEFORE_KEY, new Cell(myComponent.getSelectedRow(), myComponent.getSelectedColumn())); } sorter.setRowFilter(new RowFilter<>() { @Override public boolean include(Entry<? extends TableModel, ? extends Integer> entry) { return isMatchingRow(entry.getIdentifier(), pattern); } }); } else { UIUtil.putClientProperty(myComponent, SELECTION_BEFORE_KEY, null); sorter.setRowFilter(null); } }