Eclipse RCP: Get rid of “reset perspective” message

℡╲_俬逩灬. 提交于 2019-12-25 00:34:50

问题


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?


回答1:


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. 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.

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.



来源:https://stackoverflow.com/questions/3840386/eclipse-rcp-get-rid-of-reset-perspective-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!