Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » TreeViewer.collapseAll() is slow on OS X
TreeViewer.collapseAll() is slow on OS X [message #528613] Wed, 21 April 2010 09:39 Go to next message
Sameer  is currently offline Sameer Friend
Messages: 5
Registered: April 2010
Junior Member
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?
Re: TreeViewer.collapseAll() is slow on OS X [message #528622 is a reply to message #528613] Wed, 21 April 2010 10:05 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Am 21.04.10 11:39, schrieb Sameer:
> 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
Re: TreeViewer.collapseAll() is slow on OS X [message #528637 is a reply to message #528622] Wed, 21 April 2010 10:52 Go to previous messageGo to next message
Sameer  is currently offline Sameer Friend
Messages: 5
Registered: April 2010
Junior Member
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.
Re: TreeViewer.collapseAll() is slow on OS X [message #530747 is a reply to message #528637] Fri, 30 April 2010 16:33 Go to previous message
Al B is currently offline Al BFriend
Messages: 130
Registered: July 2009
Senior Member
Hi Sameer,

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.
Previous Topic:Invalid Acces
Next Topic:How is Eclipse built for OSX?
Goto Forum:
  


Current Time: Thu Apr 25 00:01:14 GMT 2024

Powered by FUDForum. Page generated in 0.03058 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top