Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » TreeViewer and setSelection slow
TreeViewer and setSelection slow [message #460023] Mon, 11 December 2006 15:27 Go to next message
Eclipse UserFriend
Originally posted by: danclemson.gmail.com

Hi,

I am setting selections(select 2000+ items at once) on a TreeViewer, using:

viewer.setSelection(new StructuredSelection(list), false);

This approach is very slow, and my GUI is freezed when the setSelection is running.

My tree structure is very simple(only two level, and all the selections are for the leave nodes). Is there anyway to speed up the selection or at least avoid freezing the GUI?


Thanks/dan
Re: TreeViewer and setSelection slow [message #460026 is a reply to message #460023] Mon, 11 December 2006 17:04 Go to previous messageGo to next message
Eclipse UserFriend
hi dan,

about the freezing gui: do you use another thread for the operation
(setSelection(..)) ? For example leverage the jobs api to make it async ?

Toni

dan liu schrieb:
> Hi,
>
> I am setting selections(select 2000+ items at once) on a TreeViewer, using:
>
> viewer.setSelection(new StructuredSelection(list), false);
>
> This approach is very slow, and my GUI is freezed when the setSelection is running.
>
> My tree structure is very simple(only two level, and all the selections are for the leave nodes). Is there anyway to speed up the selection or at least avoid freezing the GUI?
>
>
> Thanks/dan
Re: TreeViewer and setSelection slow [message #460031 is a reply to message #460026] Mon, 11 December 2006 21:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: danclemson.gmail.com

Hi,

I tried and get thread access exception. The eclipse treeViewer.setSelection access the SWT widget, so that I can not forge the process to a background thread.
Re: TreeViewer and setSelection slow [message #460039 is a reply to message #460031] Tue, 12 December 2006 03:55 Go to previous messageGo to next message
Eclipse UserFriend
dan liu wrote:
> Hi,
>
> I tried and get thread access exception. The eclipse treeViewer.setSelection access the SWT widget, so that I can not forge the process to a background thread.

You can combine your background thread with intermediate
Display.asyncExec calls, which synchronize into the SWT thread without
waiting for them.

Greetings from Bremen,

Daniel Krügler
Re: TreeViewer and setSelection slow [message #460050 is a reply to message #460039] Tue, 12 December 2006 10:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: danclemson.gmail.com

I did not call treeViewer.setSelection from a background thread.
It is from the SWT thread, and the setSelection(method from eclipse) from the SWT thread takes long time to finish and cause the GUI freezing.
Re: TreeViewer and setSelection slow [message #460163 is a reply to message #460023] Fri, 15 December 2006 14:24 Go to previous message
Eclipse UserFriend
Did you use a profiler to see what is taking so much time?

Did you call viewer.setUseHashLookup(true)?

If the performance problem is still there, you would have to try to do the
equivalent using just SWT to see if it is SWT (or really your window
system). Otherwise, it would have to be in JFace or your application code,
in which case you really need a profiler.

Boris

"dan liu" <danclemson@gmail.com> wrote in message
news:16448256.1165868898390.JavaMail.root@cp1.javalobby.org...
> Hi,
>
> I am setting selections(select 2000+ items at once) on a TreeViewer,
> using:
>
> viewer.setSelection(new StructuredSelection(list), false);
>
> This approach is very slow, and my GUI is freezed when the setSelection is
> running.
>
> My tree structure is very simple(only two level, and all the selections
> are for the leave nodes). Is there anyway to speed up the selection or at
> least avoid freezing the GUI?
>
>
> Thanks/dan
Previous Topic:Adding submenus to custom menus
Next Topic:Buttons on views missing
Goto Forum:
  


Current Time: Wed Mar 19 23:10:29 EDT 2025

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

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

Back to the top