Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ProgressMonitorDialog during viewer.refresh()(problem with UI thread)
ProgressMonitorDialog during viewer.refresh() [message #726684] Mon, 19 September 2011 05:16 Go to next message
Michal Niewrzal is currently offline Michal Niewrzal
Messages: 22
Registered: July 2009
Junior Member
I have quite big table with columns (more than 10 000 elements) and I provide sorting for each column. After setting sorting column and comparator parameters I need to refresh viewer. This operation take some time and I want to add any progress indicator, but refresh() method block UI from beginning to the end of refreshing, application hang for a moment. Any attempts to resolve this problem was unsuccessful. Is there any way to refresh viewer partially? Or maybe there is other way to refresh viewer after setting comparator.

I will be greatfull for any hint Smile
Re: ProgressMonitorDialog during viewer.refresh() [message #726701 is a reply to message #726684] Mon, 19 September 2011 06:04 Go to previous messageGo to next message
dwj  is currently offline dwj
Messages: 2
Registered: September 2011
Junior Member
The most time cost is to calculate the sequence of the TableItems .

so I think you can use a job, when the job compolete then refresh the view.
Re: ProgressMonitorDialog during viewer.refresh() [message #726760 is a reply to message #726701] Mon, 19 September 2011 09:08 Go to previous messageGo to next message
Michal Niewrzal is currently offline Michal Niewrzal
Messages: 22
Registered: July 2009
Junior Member
Unfortunately I have used ViewerComparator to sort items. Comparator is triggered when viewer is refreshing so from my point of view I only start refresh() method. Operation is not divisible. Probably I can manually sort my data set and put it into viewer, but right now I have no time for this and I am looking for easier fix Wink
Re: ProgressMonitorDialog during viewer.refresh() [message #726957 is a reply to message #726684] Tue, 20 September 2011 00:21 Go to previous message
Vijay Raj
Messages: 608
Registered: July 2009
Senior Member
is u r table or tableviewer virtual,if not try setting style virtual,that would make life easier...

1.http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet029VirtualTableViewer.java?view=markup

2.
http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet030VirtualLazyTableViewer.java?view=markup

In case 2 the sorting and filtering wont work,u have to do the sorting and filtering on the model and do the set input again(which by the way u can do in a job)

In case 1 i am not sure if thats the case,try it out.



---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Previous Topic:How to dislay the TableColumn Text align vertical?
Next Topic:StyledCellLabelProvider right aligned text
Goto Forum:
  


Current Time: Thu Jul 24 23:58:46 EDT 2014

Powered by FUDForum. Page generated in 0.02048 seconds