Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 08:31 Go to next message
Marc Gil is currently offline Marc GilFriend
Messages: 189
Registered: July 2009
Location: Valencia, Spain
Senior Member
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 09:52 Go to previous messageGo to next message
Devi Vara Prasad Bandaru is currently offline Devi Vara Prasad BandaruFriend
Messages: 98
Registered: March 2010
Location: Hyderabad
Member

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 10:05 Go to previous messageGo to next message
Marc Gil is currently offline Marc GilFriend
Messages: 189
Registered: July 2009
Location: Valencia, Spain
Senior Member
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 14:43 Go to previous message
Marc Gil is currently offline Marc GilFriend
Messages: 189
Registered: July 2009
Location: Valencia, Spain
Senior Member
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:Wrapped SWT Text or StyledText with fix number of characters per row
Goto Forum:
  


Current Time: Sat Dec 20 00:59:58 GMT 2014

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

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