Search in sources :

Example 11 with DomCollectionChildDescription

use of com.intellij.util.xml.reflect.DomCollectionChildDescription in project intellij-community by JetBrains.

the class AddElementInCollectionAction method getDomCollectionChildDescriptions.

@Override
@NotNull
protected DomCollectionChildDescription[] getDomCollectionChildDescriptions(final AnActionEvent e) {
    final DomModelTreeView view = getTreeView(e);
    SimpleNode node = view.getTree().getSelectedNode();
    if (node instanceof BaseDomElementNode) {
        List<DomCollectionChildDescription> consolidated = ((BaseDomElementNode) node).getConsolidatedChildrenDescriptions();
        if (consolidated.size() > 0) {
            return consolidated.toArray(new DomCollectionChildDescription[consolidated.size()]);
        }
    }
    final DomElementsGroupNode groupNode = getDomElementsGroupNode(view);
    return groupNode == null ? DomCollectionChildDescription.EMPTY_ARRAY : new DomCollectionChildDescription[] { groupNode.getChildDescription() };
}
Also used : BaseDomElementNode(com.intellij.util.xml.tree.BaseDomElementNode) DomModelTreeView(com.intellij.util.xml.tree.DomModelTreeView) DomElementsGroupNode(com.intellij.util.xml.tree.DomElementsGroupNode) DomCollectionChildDescription(com.intellij.util.xml.reflect.DomCollectionChildDescription) SimpleNode(com.intellij.ui.treeStructure.SimpleNode) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

DomCollectionChildDescription (com.intellij.util.xml.reflect.DomCollectionChildDescription)11 DomFixedChildDescription (com.intellij.util.xml.reflect.DomFixedChildDescription)5 DomGenericInfo (com.intellij.util.xml.reflect.DomGenericInfo)4 XmlTag (com.intellij.psi.xml.XmlTag)3 Type (java.lang.reflect.Type)3 NotNull (org.jetbrains.annotations.NotNull)3 Nullable (org.jetbrains.annotations.Nullable)3 Project (com.intellij.openapi.project.Project)2 PsiElement (com.intellij.psi.PsiElement)2 XmlFile (com.intellij.psi.xml.XmlFile)2 SimpleNode (com.intellij.ui.treeStructure.SimpleNode)2 AbstractDomChildrenDescription (com.intellij.util.xml.reflect.AbstractDomChildrenDescription)2 Document (com.intellij.openapi.editor.Document)1 NullableComputable (com.intellij.openapi.util.NullableComputable)1 RecursionGuard (com.intellij.openapi.util.RecursionGuard)1 PsiDocumentManager (com.intellij.psi.PsiDocumentManager)1 PsiFile (com.intellij.psi.PsiFile)1 PsiWhiteSpace (com.intellij.psi.PsiWhiteSpace)1 XmlElement (com.intellij.psi.xml.XmlElement)1 XmlElementType (com.intellij.psi.xml.XmlElementType)1