如何重新启动e4 RCP应用程序 [英] Howto restart an e4 RCP application

查看:162
本文介绍了如何重新启动e4 RCP应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果IApplication.start返回IApplication.EXIT_RESTART,则将重新启动基于3. *的RCP应用程序。 E4Application类似乎总是返回EXIT_OK。

A 3.* based RCP application will be restarted if IApplication.start returns IApplication.EXIT_RESTART. The class E4Application seems to always return EXIT_OK.

org.eclipse.ui.IWorkbench也具有重新启动方法,org.eclipse.e4.ui.workbench.IWorkbench没有

org.eclipse.ui.IWorkbench also has a restart method, org.eclipse.e4.ui.workbench.IWorkbench does not.

那么如何重新启动e4 RCP应用程序?

So how can I restart an e4 RCP application?

推荐答案

Eclipse 4.2中的当前实现导致一个ID为org.eclipse.ui.file.restartWorkbench的命令,该命令最终导致处理程序类RestartWorkbenchHandler。此类的实现如下

The current implementation in Eclipse 4.2 leads to a command with id org.eclipse.ui.file.restartWorkbench which ultimately leads to the handler class RestartWorkbenchHandler. This class is implemented as follows

public Object execute(ExecutionEvent event){

    PlatformUI.getWorkbench().restart();
    return null;
}

这意味着它依赖于Eclipse 3.x,作为PlatformUI类在纯基于Eclipse 4的应用程序中不再可用。因此,如果您想在e4应用程序中解决此任务,请创建命令,实现处理程序,当前您将具有一些E3代码依赖性!

Which means, that it is Eclipse 3.x dependent, as the PlatformUI class is not available in a pure Eclipse 4 based application anymore. So if you want to solve this task in your e4 Application, create a command, implement the handler and currently you will have some E3 code dependency!

这篇关于如何重新启动e4 RCP应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆