Search in sources :

Example 1 with XmlFileTreeElement

use of com.intellij.ide.structureView.impl.xml.XmlFileTreeElement in project intellij-plugins by JetBrains.

the class StructureViewTreeModel method getRoot.

@NotNull
@Override
public StructureViewTreeElement getRoot() {
    final XmlFile xmlFile = getPsiFile();
    final DomFileElement<DomElement> fileElement = DomManager.getDomManager(xmlFile.getProject()).getFileElement(xmlFile, DomElement.class);
    if (fileElement == null) {
        return new XmlFileTreeElement(xmlFile);
    }
    return new com.intellij.struts2.structure.StructureViewTreeElement(fileElement.getRootElement().createStableCopy());
}
Also used : DomElement(com.intellij.util.xml.DomElement) XmlFile(com.intellij.psi.xml.XmlFile) StructureViewTreeElement(com.intellij.ide.structureView.StructureViewTreeElement) XmlFileTreeElement(com.intellij.ide.structureView.impl.xml.XmlFileTreeElement) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with XmlFileTreeElement

use of com.intellij.ide.structureView.impl.xml.XmlFileTreeElement in project intellij-community by JetBrains.

the class DomStructureViewTreeModel method getRoot.

@Override
@NotNull
public StructureViewTreeElement getRoot() {
    XmlFile myFile = getPsiFile();
    final DomFileElement<DomElement> fileElement = DomManager.getDomManager(myFile.getProject()).getFileElement(myFile, DomElement.class);
    return fileElement == null ? new XmlFileTreeElement(myFile) : new DomStructureTreeElement(fileElement.getRootElement().createStableCopy(), myDescriptor, myNavigationProvider);
}
Also used : XmlFile(com.intellij.psi.xml.XmlFile) XmlFileTreeElement(com.intellij.ide.structureView.impl.xml.XmlFileTreeElement) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

XmlFileTreeElement (com.intellij.ide.structureView.impl.xml.XmlFileTreeElement)2 XmlFile (com.intellij.psi.xml.XmlFile)2 NotNull (org.jetbrains.annotations.NotNull)2 StructureViewTreeElement (com.intellij.ide.structureView.StructureViewTreeElement)1 DomElement (com.intellij.util.xml.DomElement)1