Skip to main content



      Home
Home » Eclipse Projects » JFace » jface wizard becomes not responding
jface wizard becomes not responding [message #1777426] Wed, 29 November 2017 05:36 Go to next message
Eclipse UserFriend
Hi,
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!!!

Re: jface wizard becomes not responding [message #1777452 is a reply to message #1777426] Wed, 29 November 2017 08:15 Go to previous messageGo to next message
Eclipse UserFriend
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:36
Hi,
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!!!


Re: jface wizard becomes not responding [message #1777481 is a reply to message #1777452] Wed, 29 November 2017 10:29 Go to previous message
Eclipse UserFriend
Thank you
Previous Topic:jface wizard becomes not responding
Next Topic:[SOLVED] RTL support for Wizards or TreeViewers?
Goto Forum:
  


Current Time: Wed Jul 23 10:46:10 EDT 2025

Powered by FUDForum. Page generated in 0.04077 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top