0

How can I get a list of available target definitions for a workspace programmatically? I am writing a plugin that requires to display the list of all available target platforms.

4

1 回答 1

2

ITargetPlatformServiceOSGi 服务提供有关目标平台的信息。

通过以下方式获取此信息:

ServiceReference<ITargetPlatformService> ref = bundleContext.getService(ITargetPlatformService.class);

ITargetPlatformService service = bundleContext.getService(ref);

传递给插件激活器的方法bundleContext在哪里。BundleContextstart

调用

public ITargetHandle[] getTargets(IProgressMonitor monitor)

ITargetPlatformService获取目标平台数组的方法。

于 2015-08-19T16:49:29.467 回答