|
Re: jface wizard becomes not responding [message #1777452 is a reply to message #1777426] |
Wed, 29 November 2017 13:15 |
Erdal Karaca Messages: 854 Registered: July 2009 |
Senior Member |
|
|
Are you sure you need to execute "my operation" in the UI thread?
You should not run code in the UI thread when forking (from UI thread).
If you are not sure, remove the call to the Display.async() method and execute the "my operation" code directly. If you get invalid thread access exceptions, then you need to call only that instruction in the UI thread.
Ali Sedaghat wrote on Wed, 29 November 2017 11:36Hi,
I've implemented a jface wizard in my swt application. In one page of this wizard a time-consuming operation is monitored by the wizard's progress monitor as follows:
getContainer().run(true, false, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
monitor.beginTask("", IProgressMonitor.UNKNOWN);
getShell().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
//my operation
}
}
});
monitor.done();
}
});
The problem is that the application becomes not responding a little while after the operation starts. It seems that the fork parameter has no effect, becuase my operation is executed by the UI thread!!!
|
|
|
|
Powered by
FUDForum. Page generated in 0.03054 seconds