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.

Klaus

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(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)
	at testdialog.BasicEntryPoint$1.widgetSelected(BasicEntryPoint.java:32)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:262)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:85)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:696)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:598)
	at org.eclipse.swt.widgets.Display.executeNextEvent(Display.java:1172)
	at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1153)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1143)
	at org.eclipse.rap.rwt.internal.lifecycle.ProcessAction.execute(ProcessAction.java:27)
	at org.eclipse.rap.rwt.internal.lifecycle.PhaseExecutor.execute(PhaseExecutor.java:35)
	at org.eclipse.rap.rwt.internal.lifecycle.SimpleLifeCycle.execute(SimpleLifeCycle.java:51)
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.runLifeCycle(LifeCycleServiceHandler.java:120)
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.handlePostRequest(LifeCycleServiceHandler.java:106)
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(LifeCycleServiceHandler.java:71)
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.service(LifeCycleServiceHandler.java:62)
	at org.eclipse.rap.rwt.engine.RWTServlet.handleValidRequest(RWTServlet.java:107)
	at org.eclipse.rap.rwt.engine.RWTServlet.handleRequest(RWTServlet.java:94)
	at org.eclipse.rap.rwt.engine.RWTServlet.doPost(RWTServlet.java:87)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	at org.eclipse.rap.rwt.osgi.internal.CutOffContextPathWrapper.service(CutOffContextPathWrapper.java:106)
	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:384)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
	at org.eclipse.jetty.server.Server.handle(Server.java:350)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:900)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:954)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:851)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
	at java.lang.Thread.run(Unknown 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 DialogUtil.open(dialog, Dialogcallback)

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

eg

DialogUtil.open(new 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.

Klaus
Previous Topic:Missing Constraint: Import-Package: javax.servlet; version="2.6.0
Next Topic:Absolutly no luck trying out RAP.
Goto Forum:
  


Current Time: Sat Dec 20 09:53:34 GMT 2014

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

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