package org.asciidoc.intellij.structureView;

import com.intellij.ide.structureView.StructureViewTreeElement;
import com.intellij.ide.structureView.TextEditorBasedStructureViewModel;
import org.asciidoc.intellij.psi.AsciiDocFile;
import org.jetbrains.annotations.NotNull;

/**
 * @author yole
 */
public class AsciiDocStructureViewModel extends TextEditorBasedStructureViewModel {
  protected AsciiDocStructureViewModel(@NotNull AsciiDocFile file) {
    super(file);
  }

  @NotNull
  @Override
  public StructureViewTreeElement getRoot() {
    return new AsciiDocStructureViewElement(getPsiFile());
  }
}

@@ -90,27 +90,21 @@
 tureView
-TreeElement
+Model
 ;%0Aimport
@@ -135,31 +135,78 @@
 ureView.
-TextEditorBased
+StructureViewModelBase;%0Aimport com.intellij.ide.structureView.
 Structur
@@ -202,37 +202,43 @@
 ew.StructureView
-Model
+TreeElement
 ;%0Aimport org.asc
@@ -389,23 +389,8 @@
 nds 
-TextEditorBased
 Stru
@@ -403,16 +403,72 @@
 iewModel
+Base implements%0A  StructureViewModel.ElementInfoProvider
  %7B%0A  pro
@@ -549,48 +549,103 @@
 file
-);%0A  %7D%0A%0A  @NotNull%0A  @Override%0A  public 
+, new AsciiDocStructureViewElement(file));%0A  %7D%0A%0A  @Override%0A  public boolean isAlwaysShowsPlus(
 Stru
@@ -669,16 +669,15 @@
 ent 
-getRoot(
+element
 ) %7B%0A
@@ -687,28 +687,70 @@
  return 
-new AsciiDoc
+false;%0A  %7D%0A%0A  @Override%0A  public boolean isAlwaysLeaf(
 Structur
@@ -758,29 +758,73 @@
 View
+Tree
 Element
-(getPsi
+ element) %7B%0A    return element instanceof AsciiDoc
 File
-())
 ;%0A  

Improve Structure view that only expandable elements have expand icons