Does the JGoodies list binding support binding list contents to a list object in the model? I know I can add listeners to the list model and domain model and coordinate changes between the two fairly easily, but I wasn't sure if JGoodies would do that. I could only find list binding that dealt with list selection events.
A:
I'd suggest you use GlazedLists. It's really easy to use and works great.
One issue is you have to use one of their classes that implements EventList
; you can't just bind a list model to a pre-existing List
.
Jason S
2010-02-16 19:32:15
Thanks. I think requiring to use an EventList is problematic in this case though. I have a custom list (that uses checkboxes).
Jeff Storey
2010-02-16 19:40:45
That's not hard to do. Decouple your raw data model from the rendering of your data... typically what I do is have a XXXXBean class to represent the data itself, then I use a custom TableFormat from GlazedLists to control the output of the results for the different fields of the data. I am pretty sure that if a field is a boolean then it automatically displays a checkbox. (if not then you just have to add renderers for checkboxes)
Jason S
2010-02-16 19:43:29
I do have it separated, though I like to keep a separate model that indicates which items are "checkbox selected" (vs the list selection model). I could probably build that functionality into the list model itself rather than giving the list 2 models (the 2 model are the ListModel and the CheckBoxListModel).
Jeff Storey
2010-02-16 20:11:49
ah... you do have a point there.
Jason S
2010-02-17 14:52:36
But, I will look into GlazedLists, but I think I'm still trying to figure out if the JGoodies binding will do this...
Jeff Storey
2010-02-18 00:39:02
A:
It looks like the LinkedListModel and ArrayListModel do this. I overlooked those before.
Jeff Storey
2010-02-18 03:45:41