簡體   English   中英

以編程方式獲取目標平台的列表

[英]Get list of target Platform programmatically

如何以編程方式獲取工作區的可用目標定義列表? 我正在編寫一個插件,該插件需要顯示所有可用目標平台的列表。

ITargetPlatformService OSGi服務提供有關目標平台的信息。

通過類似以下方式獲取此信息:

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

ITargetPlatformService service = bundleContext.getService(ref);

其中bundleContext是傳遞給插件激活器的start方法的BundleContext

致電

public ITargetHandle[] getTargets(IProgressMonitor monitor)

ITargetPlatformService方法來獲取目標平台的數組。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM