Improve customizability of TableFilter

Skip to first unread message

Beau Tremblay

Sep 30, 2020, 6:26:13 PM9/30/20
to ControlsFX
First off, let me say the TableFilter is a nice feature for performing filtering on categorical values.  To cover my requirements, I want to extend the functionality by creating custom filter panes that build more sophisticated predicates for different data types, similar to how Excel works:

Text column

Numeric column

The problem is I found the code very hard to extend based upon a number of design decisions:
  1. Every relevant class is final: TableColumn, ColumnFilter, and FilterPanel.
  2. FilterPanel is used in ColumnFilter as a class rather than an interface
  3. FilterPanel constructor has no modifier for its access level
  4. FilterPanel does not expose the CellFactory of its ListView, so all non-primitives need simple toStrings()
  5. FilterPanel's applyBttn action event handler accesses the columnFilter field directly.  This makes it near impossible to create another component like "AdvancedFilterPanel" that can access the columnFilter of other columns with FilterPanels.
  6. ColumnFilter attaches context menu using FilterPanel.getInMenuItem()
  7. TableFilter's constructor has been deprecated and current constructor is private (I don't see any real benefits from the Builder paradigm)
I would like to still use the library, but the issues above concern me in that I'd have nearly have to copy/paste the majority of the code to because of the decisions above.  I'm willing to make (ideally minimum changes) to make the feature better, if I was confident the changes would be accepted and integrated into the main lines.  Is there a point person whom I could work with?    I'd like some feedback on whether I should try to create another class like AdvancedFilterPanel or just make FilterPanel more versatile when dealing with different types.


Oct 15, 2020, 10:31:51 PM10/15/20
to ControlsFX
Hi Beau,

TableFilter was implemented before I took over the project. Therefore, I cannot comment on the design decisions. All of your suggestions sounds practical to me given what you want to achieve with the control.

My suggestion would be to create atomic issues related to TableFilter on Github. We can discuss further on each of these issues.

Reply all
Reply to author
0 new messages