Skip to main content



      Home
Home » Eclipse Projects » NatTable » Filtering filter dropdown(Filtering filter dropdown)
Filtering filter dropdown [message #1715317] Sat, 21 November 2015 17:10 Go to next message
Eclipse UserFriend
Hi all

I am looking to implement the ability to filter the options in the excel like filter dropdown. Before I could proceed with the implementation, I hoped to modify and contribute back changes to the NatCombo which would replace the direct use of a table with a TableViewer which supports filtering. My question is about the getSelectionIndex and getSelectionIndices methods. The use of the CheckboxTableViewer removed the need to implement the selectionListener and manually selecting the items in the table on click. As a result, the above methods don't return values because the values aren't selected, they are checked. The junit EditIntegrationTest.comboBoxShouldCommitWhenAValueIsSelectedByClickingOnIt now fails for this exact reason. Do these methods continue to serve the same purpose? Should they return the checked indices instead? Let me know what you think?
Re: Filtering filter dropdown [message #1715318 is a reply to message #1715317] Sat, 21 November 2015 18:00 Go to previous messageGo to next message
Eclipse UserFriend
NatCombo can be used with checkboxes and without. So checkboxes are optional. If you replace the table with a CheckboxTableViewer the checkboxes are always visible. Or am I wrong with that assumption?

At least that was the reason for having the listeners to synchronize the checkboxes with the selection state. There are a lot more use cases to consider when modifying the NatCombo as it is also used as simple checkbox. For this you should look at the editor example as it shows the different usage scenarios.
Re: Filtering filter dropdown [message #1715320 is a reply to message #1715318] Sat, 21 November 2015 22:55 Go to previous messageGo to next message
Eclipse UserFriend
Dirk, thanks for the help. You are correct CheckBoxTableViewer always displays the boxes. I did not realize in all the other scenarios NatCombo was used. I went back and just wrapped the table in a generic TableViewer which respects the styles passed in.

For the actual filtering, I had intended on adding an additional text box in the dropdown shell. To make it work, the text control would need to added to the same focus that the dropdown and other text controls share. What would you recommend for accomplishing this given FocusListenerWrapper is not visible in children? Expose a protected method to add a control to the focus logic?
Re: Filtering filter dropdown [message #1715328 is a reply to message #1715320] Sun, 22 November 2015 05:32 Go to previous messageGo to next message
Eclipse UserFriend
First of all, thanks that you want to take that task and contribute back. Smile

Regarding the visibility of the FocusListenerWrapper, I don't think it is a problem to make the wrapper protected instead of package protected. So if the API tooling doesn't complain, just make it protected and add the @since 1.4 which might be required.

Are you extending the FilterNatCombo for this or are you creating a new subclass?

Also I think it would be interesting to use the already available Text control for filtering, although I'm not sure if that works out. There was another thread in this forum where someone tried to accomplish this. Maybe it gives you some ideas?

https://www.eclipse.org/forums/index.php/t/1070518/

Looking forward to your contribution
Re: Filtering filter dropdown [message #1715354 is a reply to message #1715328] Sun, 22 November 2015 12:03 Go to previous messageGo to next message
Eclipse UserFriend
Great making the FocusListenerWrapper protected is the easy and what I had done locally.

So I have a working prototype of it that I made by cloning classes to make the logic work before attempting to integrate pieces back to make maintenance easier. In that prototype, I subclassed FilterNatCombo for a couple reasons.

First I wasn't sure how much of the logic the project would want to incorporate.

Secondly, as was pointed out in the topic you linked, I found the performance lacking when pre-caching the filter values. My approach was to never cache the tables values. That worked for the filtering and rendering but then I had a performance impact when scrolling cause by ComboBoxFilterIconPainter where it was checking that the collection length of filter values equals length of values from the table. This I fixed this by inverting the filter logic meaning I stored the values I did not want to see. By storing values I don't want to see the logic for the painter became filter values length > 0. I had added the logic for inverting the values in the subclass of FIlterNatCombo mostly through method overrides.

Finally, I added the additional text control because I though it would be more intuitive for the users if the box was in the dropdown shell.

That make sense?

[Updated on: Sun, 22 November 2015 12:09] by Moderator

Re: Filtering filter dropdown [message #1715356 is a reply to message #1715354] Sun, 22 November 2015 13:02 Go to previous messageGo to next message
Eclipse UserFriend
For the additional text box, I need to see it before I can make a decision. But yes, thinking about the additonal option to manually enter a filter value, it might make sense.

regarding the performance issue with the painter, I'm not sure if I understand this correctly and would need to see some code.

[Updated on: Sun, 22 November 2015 13:03] by Moderator

Re: Filtering filter dropdown [message #1718365 is a reply to message #1715356] Tue, 22 December 2015 19:49 Go to previous message
Eclipse UserFriend
Dirk
I finally had some free time to work on the filter. I pushed to Gerrit.
https://git.eclipse.org/r/63193
Previous Topic:Disable row DnD while sorted
Next Topic:FixedSummaryRowLayer
Goto Forum:
  


Current Time: Sat Jun 21 01:38:01 EDT 2025

Powered by FUDForum. Page generated in 0.06574 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top