问题
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:
- 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. - 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).
- 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