Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsTreeViewer.collapseAll() is slow on OS X
https://www.eclipse.org/forums/index.php/mv/msg/166736/528613/#msg_528613
// viewer is a TreeViewer
viewer.setInput(input);
viewer.expandAll();
viewer.collapseAll();
There are about 20 parents and each parent have 100 children.
Now, this code when run on Windows XP is very fast. Just after opening the View, the items are shown.
While the same code on Mac OS X is pretty slow, after the View is opened, there is time lag before the items are shown.
If I set redraw to false before calling collapse all and then set it to true again, the results are good -
So, I've these two questions -
1. Is setting redraw to false, true required?
2. Is this a bug in the SWT implementation for OS X?]]>Sameer 2010-04-21T09:39:26-00:00Re: TreeViewer.collapseAll() is slow on OS X
https://www.eclipse.org/forums/index.php/mv/msg/166736/528622/#msg_528622
> I've the following code in my ViewPart.createPartControl()
>
> // viewer is a TreeViewer
> viewer.setInput(input);
> viewer.expandAll();
> viewer.collapseAll();
>
> There are about 20 parents and each parent have 100 children.
>
> Now, this code when run on Windows XP is very fast. Just after opening
> the View, the items are shown.
> While the same code on Mac OS X is pretty slow, after the View is
> opened, there is time lag before the items are shown.
>
> If I set redraw to false before calling collapse all and then set it to
> true again, the results are good -
>
> viewer.expandAll();
> viewer.getTree().setRedraw(false);
> viewer.collapseAll();
> viewer.getTree().setRedraw(true);
>
> So, I've these two questions -
> 1. Is setting redraw to false, true required?
> 2. Is this a bug in the SWT implementation for OS X?
Well it limits the drawings that have to happen. I'd probably even span
the redraw=false even for the expand all. I don't consider it a bug in
SWT nor JFace.
Out of curiosity why are you expanding everything and collapsing
immediately this removes lazy loading happening in a TreeViewer.
Tom]]>Thomas Schindl2010-04-21T10:05:10-00:00Re: TreeViewer.collapseAll() is slow on OS X
https://www.eclipse.org/forums/index.php/mv/msg/166736/528637/#msg_528637
The code snippet provided here is just to show what is happening..
Also, this works fine on Windows XP. The slowness is seen only in mac OS X. So, I was wondering if this has something to do with the SWT implementation for OS X.]]>Sameer 2010-04-21T10:52:40-00:00Re: TreeViewer.collapseAll() is slow on OS X
https://www.eclipse.org/forums/index.php/mv/msg/166736/530747/#msg_530747
I'm experiencing the same problem/behavior (TreeViewer.collapseAll() is
slow on OS X) with the Carbon version of 3.5.
This doesn't happen with the Cocoa version though.
Sameer wrote:
> So, I'm contributing to an existing plugin which creates this view for
> me. Now, that plugin is expanding all the items by default but I need
> the items collasped. That's why, I call getTreeViewer().collapseAll()
> myself.
>
> The code snippet provided here is just to show what is happening..
>
> Also, this works fine on Windows XP. The slowness is seen only in mac OS
> X. So, I was wondering if this has something to do with the SWT
> implementation for OS X.]]>Al B2010-04-30T16:33:39-00:00