Search in sources :

Example 6 with StructureView

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

the class HbStructureViewFactory method getStructureViewBuilder.

@Nullable
@Override
public StructureViewBuilder getStructureViewBuilder(@NotNull final PsiFile psiFile) {
    return new TemplateLanguageStructureViewBuilder(psiFile) {

        @Override
        protected StructureViewComposite.StructureViewDescriptor createMainView(FileEditor fileEditor, PsiFile mainFile) {
            if (!psiFile.isValid())
                return null;
            final StructureViewBuilder builder = new TreeBasedStructureViewBuilder() {

                @NotNull
                @Override
                public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
                    return new HbStructureViewModel((HbPsiFile) psiFile, editor);
                }
            };
            StructureView structureView = builder.createStructureView(fileEditor, psiFile.getProject());
            return new StructureViewComposite.StructureViewDescriptor(HbLanguage.INSTANCE.getDisplayName(), structureView, HbFileType.INSTANCE.getIcon());
        }
    };
}
Also used : TreeBasedStructureViewBuilder(com.intellij.ide.structureView.TreeBasedStructureViewBuilder) TemplateLanguageStructureViewBuilder(com.intellij.ide.structureView.impl.TemplateLanguageStructureViewBuilder) StructureViewBuilder(com.intellij.ide.structureView.StructureViewBuilder) FileEditor(com.intellij.openapi.fileEditor.FileEditor) StructureView(com.intellij.ide.structureView.StructureView) TreeBasedStructureViewBuilder(com.intellij.ide.structureView.TreeBasedStructureViewBuilder) HbPsiFile(com.dmarcotte.handlebars.psi.HbPsiFile) PsiFile(com.intellij.psi.PsiFile) TemplateLanguageStructureViewBuilder(com.intellij.ide.structureView.impl.TemplateLanguageStructureViewBuilder) Editor(com.intellij.openapi.editor.Editor) FileEditor(com.intellij.openapi.fileEditor.FileEditor) Nullable(org.jetbrains.annotations.Nullable) StructureViewComposite(com.intellij.ide.structureView.impl.StructureViewComposite) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

StructureView (com.intellij.ide.structureView.StructureView)6 StructureViewBuilder (com.intellij.ide.structureView.StructureViewBuilder)5 Nullable (org.jetbrains.annotations.Nullable)4 FileEditor (com.intellij.openapi.fileEditor.FileEditor)3 PsiFile (com.intellij.psi.PsiFile)3 HbPsiFile (com.dmarcotte.handlebars.psi.HbPsiFile)2 StructureViewModel (com.intellij.ide.structureView.StructureViewModel)2 TreeBasedStructureViewBuilder (com.intellij.ide.structureView.TreeBasedStructureViewBuilder)2 StructureViewComposite (com.intellij.ide.structureView.impl.StructureViewComposite)2 TemplateLanguageStructureViewBuilder (com.intellij.ide.structureView.impl.TemplateLanguageStructureViewBuilder)2 Editor (com.intellij.openapi.editor.Editor)2 StructureViewTreeElement (com.intellij.ide.structureView.StructureViewTreeElement)1 AbstractTreeStructure (com.intellij.ide.util.treeView.AbstractTreeStructure)1 SmartTreeStructure (com.intellij.ide.util.treeView.smartTree.SmartTreeStructure)1 TreeElement (com.intellij.ide.util.treeView.smartTree.TreeElement)1 LanguageStructureViewBuilder (com.intellij.lang.LanguageStructureViewBuilder)1 PsiStructureViewFactory (com.intellij.lang.PsiStructureViewFactory)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 Navigatable (com.intellij.pom.Navigatable)1 MinusculeMatcher (com.intellij.psi.codeStyle.MinusculeMatcher)1