Eclipse RCP:摆脱“重置视角”信息
在 RCP 应用程序中,我们动态加载插件,并且我们的应用程序可以添加新插件。 当我们创建一个新插件时,我们会加载它:
newBundle = Activator.getDefault().getBundleContext().installBundle(location);
newBundle.start();
这会导致出现一个确认对话框,其中显示消息“已安装插件的更改已影响此透视图。您想重置此透视图以接受这些更改吗?”
有没有什么方法可以摆脱这个对话框,这样就不需要用户干预?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我简单地看了一下实现,看起来没有一种简单的方法可以确保该消息不存在。您可以通过查看 org.eclipse.ui.internal.WorkbenchPage.suggestReset() 的源代码来找到实现。
但是,您可能想要尝试以下几件事:
无论如何,我建议#2,然后确定#1 或#3 是最好的方法,直到您的补丁被接受。
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:
org.eclipse.ui.workbench
plugin and overwrite WorkbenchPage with an implementation of yours that implements suggestReset differently.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.