Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Custom JFace Dialogs LifeCyle
Custom JFace Dialogs LifeCyle [message #1042249] Tue, 16 April 2013 07:13 Go to next message
Klaus Ummenhofer is currently offline Klaus UmmenhoferFriend
Messages: 3
Registered: April 2013
Junior Member
Hi All,

I have a problem to show dialogs e.g. custom JFace dialogs as the LoginDialog from the Controls examples.

It seems that my application calls sleep() from the SimpleLifeCycle which causes the attached exception.

When I debug the Controls example the sleep method of the RWTLifeCycle is called which works like expected.

In order to track this and to exclude side effects from my own application I created the Hello World application from the Plugin wizard and changed it. A click on the button should show the Login dialog - which does not work.

How can I tell the application to use RWTLifeCycle instead of SimpleLifeCycle? Or do I make some other misteake maybe by setting up of the project?

Thanks for your help.


BTW: I'm working with 2.0 Release

java.lang.UnsupportedOperationException: Display#sleep() not supported in current operation mode.
	at org.eclipse.rap.rwt.internal.lifecycle.SimpleLifeCycle.sleep(
	at org.eclipse.swt.widgets.Display.sleep(
	at org.eclipse.jface.window.Window.runEventLoop(
	at testdialog.BasicEntryPoint$1.widgetSelected(
	at org.eclipse.swt.widgets.TypedListener.handleEvent(
	at org.eclipse.swt.widgets.EventTable.sendEvent(
	at org.eclipse.swt.widgets.Widget.sendEvent(
	at org.eclipse.swt.widgets.Widget.notifyListeners(
	at org.eclipse.swt.widgets.Display.executeNextEvent(
	at org.eclipse.swt.widgets.Display.runPendingMessages(
	at org.eclipse.swt.widgets.Display.readAndDispatch(
	at org.eclipse.rap.rwt.internal.lifecycle.ProcessAction.execute(
	at org.eclipse.rap.rwt.internal.lifecycle.PhaseExecutor.execute(
	at org.eclipse.rap.rwt.internal.lifecycle.SimpleLifeCycle.execute(
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.runLifeCycle(
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.handlePostRequest(
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.service(
	at org.eclipse.rap.rwt.engine.RWTServlet.handleValidRequest(
	at org.eclipse.rap.rwt.engine.RWTServlet.handleRequest(
	at org.eclipse.rap.rwt.engine.RWTServlet.doPost(
	at javax.servlet.http.HttpServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.eclipse.rap.rwt.osgi.internal.CutOffContextPathWrapper.service(
	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(
	at org.eclipse.jetty.servlet.ServletHolder.handle(
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
	at org.eclipse.jetty.servlet.ServletHandler.doScope(
	at org.eclipse.jetty.server.session.SessionHandler.doScope(
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
	at org.eclipse.jetty.server.Server.handle(
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(
	at org.eclipse.jetty.server.AbstractHttpConnection.content(
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(
	at org.eclipse.jetty.http.HttpParser.parseNext(
	at org.eclipse.jetty.http.HttpParser.parseAvailable(
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
	at org.eclipse.jetty.util.thread.QueuedThreadPool$
	at Source)
Re: Custom JFace Dialogs LifeCyle [message #1042261 is a reply to message #1042249] Tue, 16 April 2013 07:32 Go to previous messageGo to next message
Phill Perryman is currently offline Phill PerrymanFriend
Messages: 214
Registered: July 2009
Senior Member
You need to open the dialog using, Dialogcallback)

This will call the dialogClosed method when the user closes the dialog.

eg QueryDeleteDialog(getShell(), msg), new DialogCallback() {
public void dialogClosed(int returnCode) {
if (returnCode == SWT.OK) {
try {
// do something once the dialog has closed
} catch (SQLException e1) {
// handle error.
Re: Custom JFace Dialogs LifeCyle [message #1042425 is a reply to message #1042261] Tue, 16 April 2013 12:19 Go to previous message
Klaus Ummenhofer is currently offline Klaus UmmenhoferFriend
Messages: 3
Registered: April 2013
Junior Member
Hi Phill,

Thank you for your help.

I read something about the DialogUtil class before but in the Control demo this method was only used for the System Dialogs (e.g. ColorDialog). For custom dialogs the open method is called directly without the helper class being involved and it seems to work.

If you are interested check the LoginDialog class which uses JFace Dialogs.

Anyway, my problem is solved since I will stay with SWT widgets.

Thanks again.

Previous Topic:SelectionProviders in RAP have strange behavior
Next Topic:Browser Context Menu and Selectable Content
Goto Forum:

Current Time: Mon Dec 06 18:45:53 GMT 2021

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

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

Back to the top