I vahe eclipse rcp app. In my plugin A I use 3rd party plugin B. In plugin B there is plugin.xml with some extensions. In my plugin A I have added some extensions to extensions defined in plugin B, and it works.
我是eclipse rcp应用程序。在我的插件A中,我使用第三方插件B.在插件B中有plugin.xml和一些扩展。在我的插件A中,我为插件B中定义的扩展添加了一些扩展,并且它可以工作。
Now I tried to overwrite some values in some extensions from B in plugin A. Now, when I run app sometimes it uses old values (from plugin.xml in plugin B), sometimes it uses my new values (from plugin A plugin.xml). It's consistent in one execution of app, but changes from execution to execution.
现在我尝试在插件A中覆盖B中某些扩展中的一些值。现在,当我运行app时,它有时会使用旧值(来自插件B中的plugin.xml),有时它会使用我的新值(来自插件A plugin.xml) )。它在应用程序的一次执行中是一致的,但是从执行变为执行。
Code that gets these values is in plugin B and I wouldn't like to change it. And looks like that:
获取这些值的代码在插件B中,我不想更改它。看起来像那样:
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint("org.jbpm.gd.common.xmlMappings");
IExtension[] extensions = extensionPoint.getExtensions();
How can I ensure my values will be used?
我如何确保使用我的价值观?
I think it's matter of setting right order of loading of plugin.xml files, so my plugin.xml will be last, and my values will overwrite theirs, but I'm not sure how to do it.
我认为设置正确的plugin.xml文件加载顺序是关键,所以我的plugin.xml将是最后一个,我的值将覆盖他们的,但我不知道该怎么做。
1 个解决方案
#1
1
Eclipse makes no guarantees about the order that extensions are seen. Further, there is no guaranteed lifecycle for when specific plugins are loaded. If you want a guarantee, you need to implement it manually, and that will probably require a change of plugin B.
Eclipse不保证看到扩展的顺序。此外,在加载特定插件时没有保证的生命周期。如果您需要保证,则需要手动实现,这可能需要更改插件B.
#1
1
Eclipse makes no guarantees about the order that extensions are seen. Further, there is no guaranteed lifecycle for when specific plugins are loaded. If you want a guarantee, you need to implement it manually, and that will probably require a change of plugin B.
Eclipse不保证看到扩展的顺序。此外,在加载特定插件时没有保证的生命周期。如果您需要保证,则需要手动实现,这可能需要更改插件B.