use of com.intellij.codeInsight.template.impl.MacroCallNode in project intellij-community by JetBrains.
the class XmlTagInsertHandler method completeTagTail.
private static void completeTagTail(Template template, XmlElementDescriptor descriptor, PsiFile file, XmlTag context, boolean firstLevel) {
boolean completeIt = !firstLevel || descriptor.getAttributesDescriptors(null).length == 0;
switch(descriptor.getContentType()) {
case XmlElementDescriptor.CONTENT_TYPE_UNKNOWN:
return;
case XmlElementDescriptor.CONTENT_TYPE_EMPTY:
if (completeIt) {
template.addTextSegment("/>");
}
break;
case XmlElementDescriptor.CONTENT_TYPE_MIXED:
if (completeIt) {
template.addTextSegment(">");
if (firstLevel) {
template.addEndVariable();
} else {
template.addVariable(new MacroCallNode(new CompleteMacro()), true);
}
addTagEnd(template, descriptor, context);
}
break;
default:
if (!addRequiredSubTags(template, descriptor, file, context)) {
if (completeIt) {
template.addTextSegment(">");
template.addEndVariable();
addTagEnd(template, descriptor, context);
}
}
break;
}
}
Aggregations