Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP-2.0 - UnsupportedOperationException in SimpleLifeCycle.sleep() Using JDialog.open().(java.lang.UnsupportedOperationException in SimpleLifeCycle.sleep() Using JDialog.open().)
RAP-2.0 - UnsupportedOperationException in SimpleLifeCycle.sleep() Using JDialog.open(). [message #1058486] Tue, 14 May 2013 11:02 Go to next message
Erwin Hogeweg is currently offline Erwin HogewegFriend
Messages: 37
Registered: July 2009
Member
Hi,

In converting an existing RAP 1.4 to 2, I ran into an issue JFace Dialog.open(). When I call open() on a JFace Dialog Extended class I get a continuous stream of exceptions from the runloop. (see snippet below).

The exception is thrown in the SimpleLifeCycle.sleep() method.

@Override
  public void sleep() {
    String msg = "Display#sleep() not supported in current operation mode.";
    throw new UnsupportedOperationException( msg );
  }


Obviously this lifecycle doesn't like to sleep. Do I need a different LifeCycle? If so, how/where do I get/set that?

I have checked the 1.5 and the 2.0 Migration instructions but didn't see anything in there (unless I missed it).

I have seen people suggest using swt.Dialog instead. Not sure that is the right approach.

Other than this issue the migration seems to be fairly painless, so: "good job to the RAP team".

java.lang.UnsupportedOperationException: Display#sleep() not supported in current operation mode.
at org.eclipse.rap.rwt.internal.lifecycle.SimpleLifeCycle.sleep(SimpleLifeCycle.java:75)
at org.eclipse.swt.widgets.Display.sleep(Display.java:1200)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:843)
at org.eclipse.jface.window.Window.open(Window.java:818)

Any Help is Highly appreciated.

Kind Regards,

Erwin
Re: RAP-2.0 - UnsupportedOperationException in SimpleLifeCycle.sleep() Using JDialog.open(). [message #1058541 is a reply to message #1058486] Tue, 14 May 2013 12:27 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Erwin,

blocking dialogs are only supported in SWT compatibility mode [1],
supporting this API requires a dedicated UI thread on the server.
However, you can use JFace dialogs in the default mode if you set them
to non-blocking (call dialog.setBlockOnOpen(false)) and override the
methods okPressed, cancelPressed, etc. to react on the results.

HTH, Ralf

[1]
http://eclipse.org/rap/developers-guide/devguide.php?topic=application-setup.html&version=2.0

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP-2.0 - UnsupportedOperationException in SimpleLifeCycle.sleep() Using JDialog.open(). [message #1058766 is a reply to message #1058541] Wed, 15 May 2013 00:40 Go to previous message
Erwin Hogeweg is currently offline Erwin HogewegFriend
Messages: 37
Registered: July 2009
Member
Awesome Ralf, thanks for your help.

Erwin
Previous Topic:How to let the user move something over the screen?
Next Topic:RAP and BIRT
Goto Forum:
  


Current Time: Thu Apr 18 10:16:34 GMT 2024

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

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

Back to the top