0

在我的应用程序中,目标平台设置为包含我的一些自定义插件,除了 eclipse 插件。在应用程序的使用过程中,我想根据应该包含我的自定义插件的已安装文件夹检查目标平台的内容。

实际上,我想获得目标平台中所有捆绑包的列表(Eclipse 插件 + 我的自定义插件)。

我曾尝试在 ResourcesPlugin 和 PDEPlugin 中使用 getBundleContext() ,但它只返回 eclipse bas 插件而不是我的自定义插件。

4

1 回答 1

0
ITargetPlatformService service = PDECore.getDefault().acquireService(ITargetPlatformService.class);
            for (TargetBundle targetBundle: service.getWorkspaceTargetDefinition().getBundles()) {
//then get name of plugin via targetBundle.getBundleInfo().getSymbolicName()
}

此代码的问题是您收到类似于以下内容的警告:不鼓励访问:“PDECore”类型不是 API(对所需库的限制 '...\eclipse-rcp-photon-R-win32-x86_64\plugins\org .eclipse.pde.core_3.12.0.v20180516-1159.jar')

于 2020-09-30T08:17:43.917 回答