mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-27 16:57:49 +08:00
30 lines
811 B
Java
30 lines
811 B
Java
package com.simpleplugin;
|
|
|
|
import com.intellij.ide.structureView.*;
|
|
import com.intellij.ide.util.treeView.smartTree.Sorter;
|
|
import com.intellij.psi.PsiFile;
|
|
import com.simpleplugin.psi.SimpleFile;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
public class SimpleStructureViewModel extends StructureViewModelBase implements
|
|
StructureViewModel.ElementInfoProvider {
|
|
public SimpleStructureViewModel(PsiFile psiFile) {
|
|
super(psiFile, new SimpleStructureViewElement(psiFile));
|
|
}
|
|
|
|
@NotNull
|
|
public Sorter[] getSorters() {
|
|
return new Sorter[]{Sorter.ALPHA_SORTER};
|
|
}
|
|
|
|
|
|
@Override
|
|
public boolean isAlwaysShowsPlus(StructureViewTreeElement element) {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public boolean isAlwaysLeaf(StructureViewTreeElement element) {
|
|
return element instanceof SimpleFile;
|
|
}
|
|
} |