if (templates != null) {
for (IModelElement tpl : templates) {
if (CodeAssistUtils.startsWithIgnoreCase(tpl.getElementName(), prefix)) {
Template t = new Template((ModelElement) tpl, tpl.getElementName());
reporter.reportType(t, "", range);
}
}
}
// project root: "::|
} else if (bundle == null && controller == null && template != null) {
IModelElement[] templates = model.findRootTemplates(project);
if (templates != null) {
for (IModelElement tpl : templates) {
if (CodeAssistUtils.startsWithIgnoreCase(tpl.getElementName(), prefix)) {
Template t = new Template((ModelElement) tpl, tpl.getElementName());
reporter.reportType(t, "", range);
}
}
}
// bundle root: "AcmeDemoBundle::|
} else if (bundle != null && controller == null && template != null) {
IModelElement[] templates = model.findBundleRootTemplates(bundle, project);
if (templates != null) {
for (IModelElement tpl : templates) {
if (CodeAssistUtils.startsWithIgnoreCase(tpl.getElementName(), prefix)) {
Template t = new Template((ModelElement) tpl, tpl.getElementName());
reporter.reportType(t, "", range);
}
}
}
}