use of org.eclipse.wst.json.ui.contentassist.ICompletionProposalCollector in project webtools.sourceediting by eclipse.
the class CompletionProposalCollectorsRegistryReader method readElement.
protected void readElement(IConfigurationElement element) {
if (TAG_CONTRIBUTION.equals(element.getName())) {
try {
ICompletionProposalCollector collector = (ICompletionProposalCollector) element.createExecutableExtension("class");
JSONPath[] paths = createPaths(element.getAttribute("paths"));
Collection<TargetType> targets = createTargets(element.getAttribute("targets"));
String contentTypeId = element.getAttribute("contentTypeId");
CompletionProposalMatcher matcher = new CompletionProposalMatcher(targets, paths, collector);
Collection<CompletionProposalMatcher> matchersByContentType = matchers.get(contentTypeId);
if (matchersByContentType == null) {
matchersByContentType = new ArrayList<CompletionProposalMatcher>();
matchers.put(contentTypeId, matchersByContentType);
}
matchersByContentType.add(matcher);
} catch (CoreException e) {
Logger.logException(e);
}
}
}
Aggregations