Request: enable full removal of filter header

Issue #29 wontfix
altmany created an issue
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 altmany on 2012-09-30 10:39:52

Comments (6)

  1. coderazzi coderazzi repo owner

    ``` 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 issue reported on code.google.com by `coderazzi` on 2012-10-03 01:15:23

  2. coderazzi coderazzi repo owner

    ``` (No text was entered with this change) ```

    Original issue reported on code.google.com by `coderazzi` on 2012-10-03 01:15:46

  3. altmany reporter

    ``` 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 issue reported on code.google.com by `altmany` on 2012-10-03 07:23:14

  4. coderazzi coderazzi repo owner

    ``` Yep, it has sense, I will add such a method on next release,

    Cheers,

    Lu. ```

    Original issue reported on code.google.com by `coderazzi` on 2012-10-04 00:51:12

  5. coderazzi coderazzi repo owner

    ``` Yep, it makes sense, I will add such a method on next release,

    Cheers,

    Lus. ```

    Original issue reported on code.google.com by `coderazzi` on 2012-10-04 00:51:41

  6. coderazzi coderazzi repo owner
    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 issue reported on code.google.com by coderazzi on 2012-11-18 01:06:29

  7. Log in to comment