Search in sources :

Example 16 with StructureViewModel

use of com.intellij.ide.structureView.StructureViewModel in project intellij-plugins by JetBrains.

the class CucumberStructureViewCucumberTest method getTopLevelItems.

private Object[] getTopLevelItems() {
    final FileType fileType = myFile.getFileType();
    TreeBasedStructureViewBuilder builder = (TreeBasedStructureViewBuilder) StructureViewBuilder.PROVIDER.getStructureViewBuilder(fileType, myFile, getProject());
    final StructureViewModel structureViewModel = builder.createStructureViewModel(getEditor());
    Object[] children = structureViewModel.getRoot().getChildren();
    structureViewModel.dispose();
    return children;
}
Also used : FileType(com.intellij.openapi.fileTypes.FileType) TreeBasedStructureViewBuilder(com.intellij.ide.structureView.TreeBasedStructureViewBuilder) StructureViewModel(com.intellij.ide.structureView.StructureViewModel)

Aggregations

StructureViewModel (com.intellij.ide.structureView.StructureViewModel)16 StructureViewBuilder (com.intellij.ide.structureView.StructureViewBuilder)8 TreeBasedStructureViewBuilder (com.intellij.ide.structureView.TreeBasedStructureViewBuilder)7 PsiFile (com.intellij.psi.PsiFile)7 LanguageStructureViewBuilder (com.intellij.lang.LanguageStructureViewBuilder)5 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 XmlFile (com.intellij.psi.xml.XmlFile)4 LayoutViewElement (org.jetbrains.android.dom.layout.LayoutViewElement)3 LayoutStructureViewBuilder (org.jetbrains.android.dom.structure.layout.LayoutStructureViewBuilder)3 StructureView (com.intellij.ide.structureView.StructureView)2 TreeElement (com.intellij.ide.util.treeView.smartTree.TreeElement)2 Editor (com.intellij.openapi.editor.Editor)2 NotNull (org.jetbrains.annotations.NotNull)2 Nullable (org.jetbrains.annotations.Nullable)2 CommanderPanel (com.intellij.ide.commander.CommanderPanel)1 StructureViewTreeElement (com.intellij.ide.structureView.StructureViewTreeElement)1 StructureViewComposite (com.intellij.ide.structureView.impl.StructureViewComposite)1 StructureViewComponent (com.intellij.ide.structureView.newStructureView.StructureViewComponent)1 FileStructureDialog (com.intellij.ide.util.FileStructureDialog)1 AbstractTreeStructure (com.intellij.ide.util.treeView.AbstractTreeStructure)1