[p2] Querying Babel p2 repository for language packs [message #1717216] |
Thu, 10 December 2015 19:31 |
Wayne Beaton Messages: 554 Registered: December 2017 |
Senior Member |
|
|
I'm writing a little plug-in that needs to query the Babel p2 repository for language packs.
I've taken the approach of walking through the installed features and building a potential bundle id by suffixing the feature id to match the expected corresponding Babel feature. (e.g. featureId + ".nl_de" for German). I use the value to build an IQuery using the QueryUtil.createUIQuery and then mash the collection of them together as a compound query. This seems to find the features that I'm looking for.
e.g.
List<IQuery<IInstallableUnit>> featureQueries = new ArrayList<IQuery<IInstallableUnit>>();
featureQueries.add(QueryUtil.createIUQuery("org.eclipse.something.nl_de"));
featureQueries.add(QueryUtil.createIUQuery("org.eclipse.something.else.nl_de"));
...
IQuery<IInstallableUnit> query = QueryUtil.createCompoundQuery(featureQueries, false);
First question... Is this the right way to do this?
Second question... how do I do a more complex query when there are regional translations available (e.g. ".nl_fr_FR" vs. ".nl_fr_CA"). i.e. how do you form a p2 query that prefers "fr_CA" over the "fr"?
|
|
|
Powered by
FUDForum. Page generated in 0.03992 seconds