Nick-The-Uncharted / tablefilter-swing

Automatically exported from code.google.com/p/tablefilter-swing
1 stars 1 forks source link

Request: enable full removal of filter header #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After adding the filter to a JTable, I can disable it 
(TableFilterHeader.setEnabled(false)) but I cannot find a way to remove it 
altogether from the table. 

If possible, it would be nice to have a TableFilterHeader.remove() method that 
I can call to remove the filter altogether and get back to the original JTable 
appearance.

What version of the product are you using? On what operating system?
4.4

Please provide any additional information below.

Original issue reported on code.google.com by altm...@gmail.com on 30 Sep 2012 at 10:39

GoogleCodeExporter commented 9 years ago
Hi,

It is indeed possible to remove the filter header. If you launch the example 
included with the source distribution 
(http://coderazzi.net/tablefilter/download/example6.jar), you can see that the 
FilterHeader menu has the option ('On use' [checkbox]). 

The logic to remove the filter header is to set the table to null:

filterHeader.setTable(null);

Hope this helps,

Cheers,

  Lu.

Original comment by coderazzi on 3 Oct 2012 at 1:15

GoogleCodeExporter commented 9 years ago

Original comment by coderazzi on 3 Oct 2012 at 1:15

GoogleCodeExporter commented 9 years ago
thanks Luis, but I still think that a simple TableFilterHeader.remove() method 
would be useful. When I searched the javadocs I couldn't find the 
setTable(null) trick and I'm sure that others will not find it as well. But a 
remove() method will be easily found.

Original comment by altm...@gmail.com on 3 Oct 2012 at 7:23

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Yep, it makes sense, I will add such a method on next release,

Cheers,

  Lus.

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

GoogleCodeExporter commented 9 years ago
Hi, on second thoughts I am reluctant to add this method: the filter header is 
only removed if the position is defined as TOP or INLINE, but not if defined as 
NONE.

To be semantically correct, I could name the method unsetTable -but that seems 
the
same as setting the table to null-, so I am documenting better the setTable 
method and adding an entry in the How To...

Best regards,

 Lu. 

Original comment by coderazzi on 18 Nov 2012 at 1:06