I have filtered a JTable
with following RowFilter
and it works fine:
RowFilter<AbstractTableModel, Object> rowFilter = new RowFilter<AbstractTableModel, Object>(){
public boolean include(RowFilter.Entry<? extends AbstractTableModel, ? extends Object> entry){
String cellValue = entry.getValue(0).toString();
boolean isRowIncluded = cellValue.startsWith(filterText) ? true : false;
return isRowIncluded;
}
};
But I am facing an issue. I have to apply the same filter logic to TreeTable
. I have a custom table and table model extended from AbstractTableModel
. I need to filter the rows and show its parents rows (parent rows may not satisfy isRowIncluded
).
How can I achieve the functionality with my existing row filter?