Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » jface wizard becomes not responding
jface wizard becomes not responding [message #1777426] Wed, 29 November 2017 10:36 Go to next message
Ali Sedaghat is currently offline Ali SedaghatFriend
Messages: 22
Registered: April 2015
Junior Member
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 13:15 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 845
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: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 15:29 Go to previous message
Ali Sedaghat is currently offline Ali SedaghatFriend
Messages: 22
Registered: April 2015
Junior Member
Thank you
Previous Topic:jface wizard becomes not responding
Next Topic:[SOLVED] RTL support for Wizards or TreeViewers?
Goto Forum:
  


Current Time: Wed Sep 26 15:39:08 GMT 2018

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

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

Back to the top