Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [e4-dev] E4 bug/feature missing

On 21-Oct-2011, at 3:26 PM, Parvez Ahmad wrote:
> what is equivalent of PlatformUI.getWorkbench().restart() n E4
> Since in E4 we do not create workbench , so how to port old code

@Inject org.eclipse.e4.ui.workbench.IWorkbench workbench;

Eclipse 4 doesn't provide a way to restart as you could have multiple E4 applications running within the same OSGi instance.  If you really want to do a restart, you need to talk to the OSGi framework.  I have a method in my bundle activator that does something like the following:

                try {
                        FrameworkProperties.setProperty("osgi.forcedRestart",
                                        Boolean.toString(true));
                        bundleContext.getBundle(0).stop(org.osgi.framework.Bundle.STOP_TRANSIENT);
                } catch(BundleException e) {
                        logger.error("Unable to restart system.bundle", e);
                }

Hope that helps.

Brian.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Back to the top