*/
private CommentingStrategy getCommentingStrategy(String contentTypeID, ITypedRegion[] regions, Map registry) {
ensureExtensionPointRead();
CommentingStrategy match = null;
IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
/* get all the commenting strategies for the given content type id,
* including those registered for parent content types
*/
List possibleCommentingStrategies = new ArrayList();
while(contentType != null) {
List contentTypeCommentingStrategies = (List)registry.get(contentType.getId());
if(contentTypeCommentingStrategies != null && contentTypeCommentingStrategies.size() > 0) {
possibleCommentingStrategies.addAll(contentTypeCommentingStrategies);
}
contentType = contentType.getBaseType();
}
/* find the commenting strategy applicable for the given regions,
* because strategies were added starting from the most specific
* content type first, the most specific strategy will always be chosen