在运行时列出eclipse安装的插件

在运行时列出eclipse安装的插件

本文介绍了在运行时列出eclipse安装的插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一件很明显的东西,应该很容易做...

Here's something obvious that should be easy to do...

如何在运行时检索已安装的插件列表?看不到一个明显的方法来做这个Platform.getBundle()需要一个特定的插件名称。

How do I retrieve a list of installed plugins at runtime? Can't see an obvious way to do this a Platform.getBundle() requires a specific plugin name.

这可能是某种安全性原因的限制? / p>

Is this perhaps a restriction for some kind of security reason?

推荐答案

从:

类有一个 getBundles ()方法返回所有已安装的软件包。

The BundleContext class has a getBundles() method that returns all installed bundles.

当您的软件包被激活时,您会获得一个 BundleContext 的实例 BundleActivator.start BundleContext))

You get an instance of the BundleContext when your bundle is activated BundleActivator.start(BundleContext)).

您可以使用它来获取一些。

You can use it to get some Bundle version number for instance.

捆绑之间的互动通过两个补充机制完成:包导出/导入和服务注册查找工具。

The interactions between the bundles are done through two complementary mechanisms: the package export/import and the service registration lookup facility.

通过 BundleContext 参考执行服务的发布和查找,每捆在启动时间内。

在发布过程中,广告包通过发布其正在实现的Java接口注册服务,并提供实现此接口的类。

查找由客户端软件包执行,该软件包从 BundleContext 获取服务,并将其用作标准Java对象。

The publication and lookup of services are performed through the BundleContext reference that each bundle receives at startup time.
During the publication process, the advertising bundles registers a service by publishing a Java interface it is implementing, and by providing a class implementing this interface.
The lookup is performed by the client bundle, which gets the service from the BundleContext and uses it as a standard Java object.

这篇关于在运行时列出eclipse安装的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 06:25