我想查找在com.example.plugin
中聲明的org.example.extension.point
的所有擴展名。有沒有比做更有效率的方法在Eclipse RCP中獲取特定插件配置元素的有效方法
List<IConfigurationElement> result = new ArrayList<IConfigurationElement>();
IConfigurationElement[] allConfigElements =
Platform.getExtensionRegistry.getConfigurationElementsFor("org.example.extension.point");
for (IConfigurationElement ice : allConfigElements) {
if (ice.getDeclaringExtension().getNamespaceIdentifier() == "com.example.plugin")
result.add(ice);
}
return result;
?
另一種方法是先看看IContributor,然後篩選擴展點ID ... –
恐怕我不會看不懂你的意思,你能提供一些示例代碼嗎? –