|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
JXTable custom filteringHi all,
I've just started playing with JXTable and FilterPipeline - very simple to use for basic sorting and filtering based on regular expressions, but how can I filter based on other properties of the objects in my table model? In my case, I'm displaying a list of products. The table model contains a collection of Product objects which have an isWatched() method. There's a checkbox next to the table that should be able to toggle the display of watched products only based on this method. I've done this before with a standard JTable and RowFilter, but is there any nice way to accomplish the same thing using SwingX? Thanks for any help, Chris [Message sent by forum member 'cdpuk' (cdpuk)] http://forums.java.net/jive/thread.jspa?messageID=278949 --------------------------------------------------------------------- To unsubscribe, e-mail: jdnc-unsubscribe@... For additional commands, e-mail: jdnc-help@... |
|
|
Re: JXTable custom filteringjdnc-interest@... schrieb:
> Hi all, > > I've just started playing with JXTable and FilterPipeline - very simple to use for basic sorting and filtering based on regular expressions, but how can I filter based on other properties of the objects in my table model? > > In my case, I'm displaying a list of products. The table model contains a collection of Product objects which have an isWatched() method. There's a checkbox next to the table that should be able to toggle the display of watched products only based on this method. > > I've done this before with a standard JTable and RowFilter, but is there any nice way to accomplish the same thing using SwingX? > > sure - if you can do it with RowFilter simply do it in a similar way with a custom Filter implementation :-) The caveat is that SwingX filtering doesn't have an abstract filter layer (and won't get any, as the dev is stopped - core will take over as soon as we switch to 1.6), so typically the quickest (and nasty) approach is to subclass PatternFiltern and override the test method. There are some examples in the test hierarchy. HTH Jeanette --------------------------------------------------------------------- To unsubscribe, e-mail: jdnc-unsubscribe@... For additional commands, e-mail: jdnc-help@... |
|
|
Re: JXTable custom filteringHey everybody,
i've the same problem and try to filter my table with the objetcs in my table model. So i Extend MyFilter Class from the PatternFilter Class and overwrite the test() method. I try to get the Object from my Table with this code in the test() method Object lObject = getValueAt(pRow, 2); But instead of my object i get these exception: Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 Can somebody pls help me and/or just show some example coe for custom filtering? Thx a l ot! [Message sent by forum member 'pms' (pms)] http://forums.java.net/jive/thread.jspa?messageID=286651 --------------------------------------------------------------------- To unsubscribe, e-mail: jdnc-unsubscribe@... For additional commands, e-mail: jdnc-help@... |
| Free Forum Powered by Nabble | Forum Help |