Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: enable multi-choice filter #30

Open
GoogleCodeExporter opened this issue Mar 21, 2015 · 5 comments
Open

Suggestion: enable multi-choice filter #30

GoogleCodeExporter opened this issue Mar 21, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

At the moment (4.4.0), the filter choices use a simple ComboBox that enables 
selection of only a single filter choice. 

I would like to suggest implementing a multi-selection filter using checkboxes 
in the combo's popup panel, that would enable users to select multiple choices 
for filtering (like Excel 2010). 

Perhaps it could be a sub-class of ChoiceRenderer, or perhaps even better - a 
settable boolean property (default=false=single-selection behavior, just like 
the current implementation, for full backward compatibility):

   public boolean isMultiSelectionAllowed()
   public void setMultiSelectionAllowed(boolean)

(please accept my apologies if this is already implemented somewhere and I 
failed to notice)

Original issue reported on code.google.com by altm...@gmail.com on 3 Oct 2012 at 11:18

@GoogleCodeExporter
Copy link
Author

Hey, that is a very good idea. 

Implementation-wise, it does not fit very well with the current model, so I 
guess I will need some long time to get through it...

Thanks for the suggestion!

Original comment by coderazzi on 4 Oct 2012 at 12:43

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

I think this is old, but… are you still working on this project?

I would be really insterested in multi-choice filter, like in 
https://github.com/eugener/oxbow

However, your UI is much more refined and usable, especially the way it shows 
within the table.

The mentionned project provides a CheckedList that could be used to draw 
checkboxes within the list. However, the code needs to be adapted since it is 
displayed in a popup that will be dismissed on each click.

I already worked on a JMultiComboBox, but the logic is directly plugged in as a 
JComboBox inherited classes, so it would be a lot of work to adapt it to a 
single PopupMenu.

Original comment by ZeGlan...@gmail.com on 19 Jan 2015 at 4:38

@GoogleCodeExporter
Copy link
Author

Hi, I'd like to consider this project as alive, but low demanding :-) I am 
covering any bugs that impact the functionality, and I definitely use the 
tablefilter on my projects, but I am quite reluctant to include new 
functionality.

The impact of this multiselection filter is rather large: it only affects the 
GUI, indeed, but impacts all the core GUI components, including key navigation, 
basic user interaction, etc. Honestly, I lack now the time to do it properly 
and cover all possible regressions. 

But if you feel like coding it yourself, I could definitely assist / support 
you.

 Lu/

Original comment by coderazzi on 19 Jan 2015 at 10:25

@GoogleCodeExporter
Copy link
Author

Indeed.

I've started to hack it, and after successfully drawing a checkbox in the list. 
This is kind of an easy part, except that I had to understand the whole code 
for that (in FilterListCellRenderer).

But then, I realized that the logic of a single selected element is everywhere 
in PopupComponent. The MouseHandler should be the entry point to the currently 
clicked element, but the rest of the code assumes that there is only one 
selected element: the renderer (not so bad), the choiceSelected method (we 
could create a Proxy object?), and some other.
But it implies to hack the logic. A better way should be to use multi-selection 
list everywhere, even when there is only one…

Anyway, there is a lot of work, I don't know if I'll have time for this…

Original comment by ZeGlan...@gmail.com on 20 Jan 2015 at 3:20

@GoogleCodeExporter
Copy link
Author

Well, indeed the PopupComponent assumes a single selection, but extending its 
interface to support multiple choices shouldn't be the problem; the 
FilterListCellRenderer can be extended to support checkboxes, and overall there 
is probably more work to ensure than no bugs are included in the system than 
implementing the new functionality itself.

However, the whole interface (API and GUI) requires major thinking. For example:

-What is shown on the editor when multiple choices are selected? Currently, we 
just show the selected one, so it is not a problem at all.

-API: we have currently a setContent method to define the choice. It is enough 
to just pass a collection to this method?

The filtering itself already implements OR logic. In fact, in the very first 
versions of tablefilter, the user could enter complex boolean expressions on 
the filters, such as choice 1 OR choice 2 AND choice 3....

In any case, I would definitely not hack the solution. As you say, using 
multi-selection as base model seems definitely the best approach.

Original comment by coderazzi on 21 Jan 2015 at 12:05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant