ModalContext.setAllowReadAndDispatch does not work correct as comment [message #1805769] |
Tue, 23 April 2019 08:04  |
Eclipse User |
|
|
|
Hello everyone,
Currentlly, I am executing a job in the UI thread that takes a long time, but I don't what it to hand the UI.
So I use the ModalComtext.run(...) method to put the job into a non-UI thread, then I can click on the UI interface during the execution of this job.But I got exections that the widget is disposed.
I found out that this is because display.readAndDispatch is called in the method ModalComtextThread.block() to respond to the UI event. Then I use ModalContext.setAllowReadAndDispatch(false) first.
But the strange thing is that the job is now running in the UI thread, it will hang up the UI, this is not the result I expected. What should I do?
Best Regards
[Updated on: Wed, 24 April 2019 01:25] by Moderator
|
|
|
|
Re: ModalContext.setAllowReadAndDispatch does not work correct as comment [message #1805827 is a reply to message #1805806] |
Wed, 24 April 2019 23:33  |
Eclipse User |
|
|
|
Hello Brian,
Many thanks for your suggestion. Both methods are effective for my case.
The difference I see is that if I select change 3 times, Workbench's IProgressService will respond to all job one by one, but IWorkbenchWindow#run() only responds to the first and last ones, and the second has been canceled. Right?
Best Regards,
[Updated on: Thu, 25 April 2019 03:47] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03678 seconds