Running Long UIJobs with progress(is this the solution?) [message #532152] |
Fri, 07 May 2010 07:05  |
Eclipse User |
|
|
|
Hi,
I have a utility which exports Table/Tree content to HTML with all its labels and icons.
Since this involves accessing GUI elements,this export hangs the GUI.
I tryed to put the whole process in a UIJOB,syncexec etc
but the progress dialog was not able to show up.
Hence in the loop where each Table/Tree item is processed i added the code
Display.getcurrent().readAndDispatch();
this solved the problem and the progress monitor dialog got updated properly.
Is this correct?
Are there any side effects???
Thanks in advance for your replys.
[Updated on: Fri, 07 May 2010 07:20] by Moderator
|
|
|
|
Re: Runting Long UIJobs with progress [message #532489 is a reply to message #532461] |
Mon, 10 May 2010 05:00  |
Eclipse User |
|
|
|
Any SWT Application or RCP application has this loop
while (!shell.isDisposed())
{
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
Since we are doing a long loop on display thread its not able to read and dispatch ,hence what if we do it in between loops for such situations...
For that matter a UIJob does not make sence appart from running the task in ui thread it servers no pupose of a job(progress,manage etc)
Also what if there is setuation where you have to do a long job on ui,should we leave the UI blank and un responsive???
[Updated on: Mon, 10 May 2010 05:03] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03428 seconds