Community
Participate
Working Groups
Steps To Reproduce: IWorkbench.restart closes the workbench but does not open a new workbench window. After closing only the gradient html background is shown. More information: RAP 1.0 CVS
public class TestRestartWorkbench extends ViewPart { public void createPartControl( Composite parent ) { Button btn = new Button( parent, SWT.NONE ); btn.setText( "Restart Workbench" ); btn.addSelectionListener( new SelectionListener() { public void widgetSelected( SelectionEvent e ) { PlatformUI.getWorkbench().restart(); }; public void widgetDefaultSelected( SelectionEvent e ) { }; } ); } }
I need to support the use case where the user logs in using a dialog, opens the workbench, logs out & closes the workbench. Then he can can login again with the login dialog. The idea has been posted by Frank Appel: display creation while( !exit ) loginShell createWorkbench If the restart, or workbench.close + createAndRunWorkbench is not supported, is there a workaround?
We have the same problem. We need to restart the workbench and it doesn't work: /* * WorkbenchUtils.java */ ... public static IWorkbench getWorkbench() { return PlatformUI.getWorkbench(); } public static Display getDisplay() { Display display; display = getWorkbench().getDisplay(); if ( null == display ) display = Display.getCurrent(); if ( null == display ) display = Display.getDefault(); return display; } public static restart() { getDisplay().asyncExec(new Runnable() { public void run() { getWorkbench().restart(); } }); } ...
One could create a browser widget that redirects to the entrypoint url after the workbench is closed. But using that solution would be nice if it was possible to find out the url of the entryPoint that is currently used (including) port, so that one has not to hardcode the link to the browserwidget. Is there a way to find out the currently used url?
*** Bug 432649 has been marked as a duplicate of this bug. ***
Are there any plans to fix this? It has been over 7 years since it was open. Did RAP users find a workaround or just gave up on it?
It's currently not in our plans. The workaround is to trigger page reload with JavaScriptExecutor - see [1] [1] http://www.eclipse.org/forums/index.php/mv/msg/29465/1259896/#msg_1259896
(In reply to Ivan Furnadjiev from comment #7) > It's currently not in our plans. The workaround is to trigger page reload > with JavaScriptExecutor - see [1] > > [1] http://www.eclipse.org/forums/index.php/mv/msg/29465/1259896/#msg_1259896 Unfortunately, the workaround is of no help for us at all. I just posted reply to on the forums but will duplicate it here: This workaround only stops current UISession and creates a new one within the same JVM process. It doesn't help if one is trying to have Eclipse workbench restarted in order to have a new VM process allocated upon restart. In our case we need the server (Eclipse with embedded Jetty) to be truly restarted and the lack of Workbench.restart() implementation is blocking us from doing that.
(In reply to Barys Dubauski from comment #8) > Unfortunately, the workaround is of no help for us at all. I just posted > reply to on the forums but will duplicate it here: > > This workaround only stops current UISession and creates a new one within > the same JVM process. It doesn't help if one is trying to have Eclipse > workbench restarted in order to have a new VM process allocated upon > restart. In our case we need the server (Eclipse with embedded Jetty) to be > truly restarted and the lack of Workbench.restart() implementation is > blocking us from doing that. As I explained in the newsgroup, Workbench restart *can't* be implemented in a way to restart the servlet container (VM process). It's not a responsibility of a single web application to restart the servlet container. What will happen with other web applications in the same servlet container than!?
(In reply to Ivan Furnadjiev from comment #9) > (In reply to Barys Dubauski from comment #8) > > Unfortunately, the workaround is of no help for us at all. I just posted > > reply to on the forums but will duplicate it here: > > > > This workaround only stops current UISession and creates a new one within > > the same JVM process. It doesn't help if one is trying to have Eclipse > > workbench restarted in order to have a new VM process allocated upon > > restart. In our case we need the server (Eclipse with embedded Jetty) to be > > truly restarted and the lack of Workbench.restart() implementation is > > blocking us from doing that. > > As I explained in the newsgroup, Workbench restart *can't* be implemented in > a way to restart the servlet container (VM process). It's not a > responsibility of a single web application to restart the servlet container. > What will happen with other web applications in the same servlet container > than!? : Perhaps, I'm missing something so please forgive my ignorance here. But since RAP substitutes Eclipse's Workbench implementation with RAP version, that doesn't leave any choices for doing the servlet container restart by any means (not just from within a web application). In our specific case there aren't any other web applications in our setup to worry about. We relied on RAP to perform the port of our SWT RCP application to web (hence there aren't any other applications in the picture). If the Workbench.restart() implementation was functional but was disabled in the org.eclipse.rap.ui.workbench bundle based on this considerations wouldn't be a better choice to leave it there but update the javadoc with a warning to exercise caution when invoking it when there are multiple web applications running?
(In reply to Barys Dubauski from comment #10) > If the Workbench.restart() implementation was functional but was disabled > in the org.eclipse.rap.ui.workbench bundle based on this considerations > wouldn't be a better choice to leave it there but update the javadoc with a > warning to exercise caution when invoking it when there are multiple web > applications running? Do you think it's possible to restart multiple (how many???) servlet containers like Tomcat, JBoss, WebLogic and others with a single implementation? I doubt. And once again, I don't think that the correct Workbench#restart implementation includes servlet container restart.