Eclipse 插件:获取源包的安装位置
我正在创建一个 IClasspathContainer,它可以使用 eclipse 访问已安装的 OSGi Bundle(Eclipse 插件)。我通过以下方式获取捆绑包的 IPath
Bundle bundle = Platform.getBundle(pluginId);
fullPath = FileLocator.getBundleFile(
return Path.fromOSString(fullPath);bundle).getAbsolutePath();
但是,如果安装了源捆绑包,我还想提供源代码。源包由 eclipse 命名,例如对于插件 org.example.myplugin,源包名为 org.example.myplugin.source。
有人知道如何访问源包吗?
I am creating an IClasspathContainer that access an installed OSGi Bundle (Eclipse Plugin) withing eclipse. I get the IPath for the bundle by
Bundle bundle = Platform.getBundle(pluginId);
fullPath = FileLocator.getBundleFile(
return Path.fromOSString(fullPath);bundle).getAbsolutePath();
However I also want to offer the sources if the source bundle is installed. The source bundle is named by eclipse e.g. for a plugin org.example.myplugin the source bundle is named org.example.myplugin.source.
Does anybody know how to access the source bundle?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有直接的方法可以通过符号名称找到 OSGi 包,但是可以通过循环遍历所有包来轻松地找到它。
可以通过以下方式访问捆绑包的位置:
There is no direct way to find an OSGi bundle by it's symbolic name, but one can easily do that oneself by looping through all bundles.
The location of the bundle can be accessed as: