[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: KTable: Right handling of TableModel

Hi,

You definitely want to cache DB content locally in a hashmap or something similar, since otherwise, every drawing event on the table would generate a new query on the DB.

Just to be clear:
On every draw event and for the necessary calculations, KTable calls the tablemodel methods (like getRowCount(), getContent(), ...). So performance highly depends on the implementation of your tablemodel. When tablemodel methods are expensive, the table ui will become slow...


regards,
Lorenz


Rudolf Schmidt wrote:
Hi,

first I hope this is the right newsgroup for questions about the swt KTable widget, well, at least I couln't find another ;)

I am new to KTable and so I wonder what's the right way to get the data in the TableModel. For example JFace viewers are first contructed and afterwards you set the data via setInput(..). How would I do that with KTable? Lets assume I want to load some data from database using a business method which returns the data from db in a list with some valueobjects.

Would I create a setData(...) method on my tablemodel implementation and transform the data to some kind of hashmap in the tablemodel? Or would the business call be made within the tablemodel? The examples all come preloaded so I couln't learn from that ;)

Thanks for suggestions,

Rudolf