Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to restart a rap-session?
How to restart a rap-session? [message #127913] Tue, 14 April 2009 09:47 Go to next message
p-lex is currently offline p-lexFriend
Messages: 18
Registered: July 2009
Junior Member
Hello,

Refering to my post on
( http://www.eclipse.org/newsportal/article.php?id=5776&gr oup=eclipse.technology.rap#5776)
I want to restart the session when the timeout was reached.

Is there a way to do it? I'm still searching for a solution.

If I run the exit-action (ActionFactory.QUIT.create(window)) the app just
exits. But how can I realize a restart-behavior?

Thanks
Re: How to restart a rap-session? [message #128020 is a reply to message #127913] Wed, 15 April 2009 11:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hi,
you could achieve a restart by creating a browser widget on a new shell
after the workbench stopped.

This would be in your Entrypoint and looks about like this:

----------------------------------------------------
public int createUI() {
Display display = PlatformUI.createDisplay();
int result = PlatformUI.createAndRunWorkbench(display,
new ApplicationWorkbenchAdvisor());

Shell shell = new Shell( display, SWT.NONE );
shell.setLayout( new FillLayout() );
Browser browser = new Browser( shell, SWT.NONE );
String page = "<html><head><title></title>"
+ "<meta http-equiv=\"refresh\"
content=\"0;url=http://www.google.com\";>"
+ "<script type=\"text/javascript\">"
+ "if (top != self) top.location = self.location;"
+ "</script></head><body></body></html>";
browser.setText( page );
shell.setMaximized( true );
shell.open();

return result;

}
----------------------------------------------------

Replace the URL (here google.com) by the URL to your rap servlet and the
restart is done.

Regards,
Björn

p-lex schrieb:
> Hello,
>
> Refering to my post on
> ( http://www.eclipse.org/newsportal/article.php?id=5776&gr oup=eclipse.technology.rap#5776)
> I want to restart the session when the timeout was reached.
>
> Is there a way to do it? I'm still searching for a solution.
>
> If I run the exit-action (ActionFactory.QUIT.create(window)) the app
> just exits. But how can I realize a restart-behavior?
>
> Thanks
>
Re: How to restart a rap-session? [message #128142 is a reply to message #128020] Thu, 16 April 2009 10:31 Go to previous message
p-lex is currently offline p-lexFriend
Messages: 18
Registered: July 2009
Junior Member
thx a lot , works fine.

I've modified your solution to:
------------------------------------------------------------ ---------------------
protected void restart() {
String url = URLHelper.getURLString(false);
Shell shell = new Shell(Display.getCurrent(), SWT.NONE);
Browser browser = new Browser(shell, SWT.NONE);
String page = "<html><head><title></title><meta http-equiv=\"refresh\"
content=\"0;url=" + url + "\";>"
+ "<script type=\"text/javascript\">" + "if (top != self) top.location
= self.location;"
+ "</script></head><body></body></html>";
browser.setText(page);
shell.setMaximized(true);
shell.open();
}
------------------------------------------------------------ ---------------------

So the way it works how it should work by reaching a Session-timeout, too.

I'm on the way to get so solution for that, too. I will post it later.
Previous Topic:Upgrading to qooxdoo 8.2 anytime soon?
Next Topic:RWT Standalone + MenuBar
Goto Forum:
  


Current Time: Tue Apr 23 16:48:25 GMT 2024

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

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

Back to the top