blob: 4a0e29cca4452910b332ebc57d895b7f875ff3e3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.intellij.schema.structure;
import com.intellij.ide.structureView.StructureViewBuilder;
import com.intellij.ide.structureView.StructureViewModel;
import com.intellij.ide.structureView.TreeBasedStructureViewBuilder;
import com.intellij.lang.PsiStructureViewFactory;
import com.intellij.openapi.editor.Editor;
import com.intellij.psi.PsiFile;
/**
* This class is used for the extension (in plugin.xml) to the class SdStructureViewModel. It make the IDE use our
* plugin's code when creating the "Structure View" window.
*
* @author Shahar Ariel
*/
public class SdStructureViewFactory implements PsiStructureViewFactory {
public StructureViewBuilder getStructureViewBuilder(PsiFile psiFile) {
return new TreeBasedStructureViewBuilder() {
@Override
public StructureViewModel createStructureViewModel(Editor editor) {
return new SdStructureViewModel(psiFile);
}
};
}
}
|