Eclipse RCP:摆脱“重置透视图”信息 [英] Eclipse RCP: Get rid of "reset perspective" message

查看:147
本文介绍了Eclipse RCP:摆脱“重置透视图”信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在RCP应用程序中,我们动态加载插件,我们的应用程序可以添加新的插件。
当我们创建一个新的插件,然后我们加载它:

In an RCP application, we dynamically load plugins and our applicaton can add new plugins. When we create a new plugin, we then load it with:

newBundle = Activator.getDefault().getBundleContext().installBundle(location);
newBundle.start(); 

这将导致出现一个确认对话框,并显示消息已安装的插件的更改已影响此透视图。你想重置这个观点以接受这些变化吗?

This causes a confirmation dialog appears with the message "Changes to installed plug-ins have affected this perspective. Would you like to reset this perspective to accept these changes?"

有没有办法摆脱这个对话框,以便用户干预不是必需的? >

Is there any way of getting rid of this dialog so that user intervention is not required here?

推荐答案

我简要地看了一下实现,看起来好像没有一个简单的方法来确保消息不存在。您可以通过查看 org.eclipse.ui.internal.WorkbenchPage.suggestReset()的源代码来找到该实现。

I took a brief look at the implementation and it doesn't look like there is an easy way to ensure that the message doesn't exist. You can find the implementation by looking at the source code for org.eclipse.ui.internal.WorkbenchPage.suggestReset().

但是,有几件事你可能想尝试:

However, there are several things that you may want to try:


  1. 由于您正在创建一个RCP应用程序,并且可能拥有对用户安装的控制权,您可以使用 org.eclipse.ui.workbench 插件的功能修补程序来运送应用程序,并覆盖WorkbenchPage与实现suggestReset的实现不同。

  2. 您可以在Eclipse的bugzilla中提出一个错误,并附加一个补丁。将修补程序修复到3.7(尽管时间不多了)还不算太晚。

  3. 您可以使用具有所需行为的更改的WorkbenchPage表单来运送RCP应用程序。

  1. since you are creating an RCP app and presumably have control over what users install, you can ship your app with a feature patch for the org.eclipse.ui.workbench plugin and overwrite WorkbenchPage with an implementation of yours that implements suggestReset differently.
  2. You can raise a bug for this in Eclipse's bugzilla and attach a patch. It is not too late to get the fix into 3.7 (although time is running out).
  3. You can ship your RCP app with an altered form of WorkbenchPage that has the behavior that you require.

我建议#2无论什么,然后确定#1或#3是否是最好的方式去,直到你的补丁被接受。

I'd suggest #2 no matter what and then determine whether #1 or #3 is the best way to go until your patch is accepted.

这篇关于Eclipse RCP:摆脱“重置透视图”信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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