Running Long UIJobs with progress(is this the solution?) [message #532152] |
Fri, 07 May 2010 11:05 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
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.
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
[Updated on: Fri, 07 May 2010 11:20] Report message to a moderator
|
|
|
|
Re: Runting Long UIJobs with progress [message #532489 is a reply to message #532461] |
Mon, 10 May 2010 09:00 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
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???
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
[Updated on: Mon, 10 May 2010 09:03] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04285 seconds