use of org.eclipse.wst.json.ui.contentassist.ICompletionProposalCollector.TargetType 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);
}
}
}
use of org.eclipse.wst.json.ui.contentassist.ICompletionProposalCollector.TargetType in project webtools.sourceediting by eclipse.
the class CompletionProposalCollectorsRegistryReader method createTargets.
private Collection<TargetType> createTargets(String value) {
String[] s = value.split(",");
Collection<TargetType> targets = new ArrayList<ICompletionProposalCollector.TargetType>();
for (int i = 0; i < s.length; i++) {
targets.add(TargetType.valueOf(s[i].trim()));
}
return targets;
}
Aggregations