[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Tree and TreeItem help

Hi Grant,

I'm using a SWT.SetData handle to perform database queries for the all 
sub-items. Nevertheless, it is not bing called when I call clearAll.

I tested by creating a 100.000 items tree(table) and then calling clearAll, 
and in the SWT.SetData handle a println just to check. Once the table is 
cleaned the SetData listener is not invoked. Therefore, no database 
operation is being performed during the cleanup. But, the cleanup is 'til 
taking to long.


"Grant Gayed" <grant_gayed@xxxxxxxxxx> wrote in message 
news:eh7uej$ccd$1@xxxxxxxxxxxxxxxxxxxx
> Hi Nadilson,
>
> Do you know precisely where the performance problem is occurring? 
> Accessing
> the database is usually (or at least should be) the slowest part in these
> scenarios.  clearAll() and setItemCount() should not be expensive by
> themselves, though they could appear to be if your SetData listener does
> anything that's time-consuming.  And which platform do you see this on?
>
> Grant
>
>
> "Nadilson Ferreira" <nadilson@xxxxxxxxx> wrote in message
> news:eh14i1$rf0$1@xxxxxxxxxxxxxxxxxxxx
>> Hi All,
>>
>> I'm facing a trick problem with Tree/TreeColumn/TreeItem when creating 
>> and
>> cleaning up the Tree content. I need to perform queries to a database and
>> show the result set in a table. But for instance, one query can return
>> 100.000 items and the direct next query just 10. After executing the 
>> query
>> for populating the Table (Tree+TreeColumn), I'm calling Tree.clearAll(),
> in
>> order to clean all content. But the performance is really bad.
>>
>> // fragment
>> public void setInput(RootNode root) {
>>   tree.clearAll(true);
>>   if (root != null) {
>>      tree.setData(root);
>>      tree.setItemCount(root.getChildren().length());
>>
>>      if (tree.getItemCount() > 0) {
>>         tree.showItem(tree.getItem(0));
>>      }
>>   }
>> }
>> // end fragment
>>
>> Do you guys have any suggestion?
>>
>> Thanks,
>>
>> NF
>>
>>
>>
>
>