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

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