Custom TableModel?

View: New views
3 Messages — Rating Filter:   Alert me  

Custom TableModel?

by Eric Jönsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Good evening.

I'm using glazedlists-1.8.0_java15.jar

In an attempt to separate my table (view) from the data, (model) I'm
currently extending EventTableModel to contain not only the source list,
but Sorted/FilterLists as well. Ideally, I'd like to simply supply:

new MyTableModel();

...And have that one create a BasicEventList, wrap it in a SortedList,
wrap that in a FilterList, install comparator chooser, etc.

I'm almost there, but I'm stumbling on one tiny detail.

The table (view) doesn't update as it should whenever the user writes
something in the TextComponentMatcherEditor. I need to resize the window
in order to force it to redraw, which is obviously not going to make my
boss happy. I reckon some sort of event should be fired somehow, but I'm
not sure how to do it. Can I call upon the EventTableModel parent to do
it somehow? If so, which method should I override, and with what?

Thanks in advance.

/Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Parent Message unknown Re: Custom TableModel?

by Holger Brands :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Eric,

If the FilterList with your TextComponentMatcherEditor is part of
your list pipeline connected to your EventTableModel, it should react
to the changed filter criteria automatically.
But without seeing some example code, it's difficult to tell what's going on...

Holger

P.S.:
I wouldn't recommend to extend EventTableModel to build up your
source EventList for the table. I'd keep the list building separate from
model creation, but that's just my opinion.
Please note that EventTableModel will be deprecated in the next version
in favour of DefaultEventTableModel, which does not try to automatically
wrap your source list with a thread proxy list, giving more control to the user.
Also, there will be factory methods as preferred way for model creation,
hiding implementation classes.


> Good evening.
>
> I'm using glazedlists-1.8.0_java15.jar
>
> In an attempt to separate my table (view) from the data, (model) I'm
> currently extending EventTableModel to contain not only the source list,
> but Sorted/FilterLists as well. Ideally, I'd like to simply supply:
>
> new MyTableModel();
>
> ...And have that one create a BasicEventList, wrap it in a SortedList,
> wrap that in a FilterList, install comparator chooser, etc.
>
> I'm almost there, but I'm stumbling on one tiny detail.
>
> The table (view) doesn't update as it should whenever the user writes
> something in the TextComponentMatcherEditor. I need to resize the window
> in order to force it to redraw, which is obviously not going to make my
> boss happy. I reckon some sort of event should be fired somehow, but I'm
> not sure how to do it. Can I call upon the EventTableModel parent to do
> it somehow? If so, which method should I override, and with what?
>
> Thanks in advance.
>
> /Eric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>


______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Custom TableModel?

by Eric Jönsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Holger Brands wrote:
Hi Eric,

If the FilterList with your TextComponentMatcherEditor is part of
your list pipeline connected to your EventTableModel, it should react
to the changed filter criteria automatically.
But without seeing some example code, it's difficult to tell what's going on...
Yes, it was a rather strange behaviour. I believe I found a way to refresh the table, but I must have fired far too many events because the performance dropped significantly to the point of being unusable. I reverted back to your suggestion (like the tutorial does it) and things are working like they should again.

Well, atleast I tried. Thanks for replying. :)