Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 443218

Summary: ProgressMonitorDialog does not work
Product: [RT] RAP Reporter: Dave Smith <dave.smith>
Component: JFaceAssignee: Project Inbox <rap-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Dave Smith CLA 2014-09-03 09:55:15 EDT
Using the example from
https://github.com/eclipse/rap/blob/master/examples/org.eclipse.rap.examples.pages/src/org/eclipse/rap/examples/pages/DialogExamplePage.java

causes this pop up a dialog that 
Display#sleep is not supported in current operation mode

The issue is that in ModelContext.run you create a thread to execute the work, start it and then proceed to call block() on the next line waiting for it to finish. 

What should happen is in the ProgressMonitorDialog.run() if it is set to non blocking (which I think it always is) and fork it should start a ServerPushSession and notify ModalContext to fork and not block. Then we should return from the run , the web page will show the progress dialog while the server push should update it.

I guess the trick is to wrap up the passed in IRunnableWithProgress so you can start/end the server push session and call the finishRun();
Comment 1 Ivan Furnadjiev CLA 2014-09-03 10:32:46 EDT
It seems that your application is running in JEE_COMPATIBILITY mode. This is the reason for the exception. Try to set your operation mode to SWT_COMPATIBILITY. See also OperationMode#JEE_COMPATIBILITY JavaDoc for more details, where is clearly stated that "blocking dialogs aren't possible".
Could you create a simple test project to demonsrate the issue?
Comment 2 Dave Smith CLA 2014-09-03 11:06:55 EDT
The ProgressDialog is set to non blocking and is not honoring it. (	setBlockOnOpen(false); ) It is treating it as a blocking dialog, thus the error.
It is different than most Dialogs because the open done when the run method is called. 

The link provided is the DialogExample page in the org.eclispe.rap.examples.pages.  Deploy that bundle and then do a 

new DialogExamplePage().createControl(parent); in your EntryPointFactory you should be able to re-create. 

In SWT_COMPATIBILITY you will not get the error but you will also not get the dialog, it will just perform the work.
Comment 3 Ivan Furnadjiev CLA 2014-11-24 05:21:34 EST
Dave, I don't get what is the problem. Could you provide a complete snippet/project that demonstrate the issue?  Our example (ProgressMonitorDialog in DialogExamplePage.java) works.
Comment 4 Ivan Furnadjiev CLA 2015-10-27 05:55:29 EDT
.

*** This bug has been marked as a duplicate of bug 380650 ***