Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Latency when refresh a Tree with many elements
icon9.gif  Latency when refresh a Tree with many elements [message #644547] Mon, 13 December 2010 03:31 Go to next message
Eclipse UserFriend
Hi,

I have implemented a View that shows the content of the current model the user is working with, i.e. a Model Explorer View. I have a listener in this view that against any change in the ResourceSet (add, remove or change an element in the current resource), refreshes the Tree to show the results.

There is a problem with this refresh when the Tree has many elements (> 300 aproximately). There exists any way to improve the refresh of the tree? The simple code I execute is the following:

if (viewer != null && !viewer.getTree().isDisposed()) {
	viewer.refresh();
}


Also occurs if I expand a Leaf of the Tree that contains many elements.

Thanks!
Marc
Re: Latency when refresh a Tree with many elements [message #644561 is a reply to message #644547] Mon, 13 December 2010 04:52 Go to previous messageGo to next message
Eclipse UserFriend
Have you tried using these methods ?
org.eclipse.jface.viewers.StructuredViewer.refresh(Object)
org.eclipse.jface.viewers.StructuredViewer.update(Object[], String[])

Re: Latency when refresh a Tree with many elements [message #644565 is a reply to message #644561] Mon, 13 December 2010 05:05 Go to previous messageGo to next message
Eclipse UserFriend
Prasad,

Update method is not valid, cause its purpose is to update, for example, the label of an element.

Refresh method, refreshed the entry Tree or the contents of the element you specify. The problem appears when this element contains many elements (> 300). I think it's a general problem in SWT, because in other technologies it doesn't happen.

Thanks for your response.
Marc
Re: Latency when refresh a Tree with many elements (Solved) [message #644629 is a reply to message #644565] Mon, 13 December 2010 09:43 Go to previous message
Eclipse UserFriend
Well, it seems it's a problem in my code, due to I do some things in the hasChildren, getText and getImage methods that increments the spended time in this methods, and in the refresh.

So this post is not valid. Sorry!
Marc
Previous Topic:Vertical TabFolder/TabItem
Next Topic:XWT and Eclipse 3.6??
Goto Forum:
  


Current Time: Tue Jul 01 14:51:06 EDT 2025

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

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

Back to the top