[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,

thanks for your help. It seems that it's advisable to have a setInput() 
Method on the tablemodel to refresh the data.

By the way another questions concerning ktable arised. Let's assume I want 
to format all cells nearly the same, but different background colours. Seems 
thats there two ways to do that. I could either have two different renderers 
or one renderer which background attribute changing back and forth in the 
doGetCellRenderer Method?

Is there a way to chance the color of the space between the cells. Or is the 
only way to do that by subclassing e.g. the textcellrenderer?

Thanks,

Rudolf



"Lorenz Maierhofer" <lorenz.m@xxxxxx> schrieb im Newsbeitrag 
news:dj8lg8$fs0$1@xxxxxxxxxxxxxxxxxxx
> 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