Auto Expand Custom Structure View

Answered

Hello,

I'm making a plugin which has a custom Structure View,, and to do this I create a new instance of  com.intellij.ide.structureView.newStructureView.StructureViewComponent and pass in the appropriate elements.

The tree renders, however every node has the ability to be expanded, even if it doesn't have children. I have tried using StructureViewComponent.getTree() and expanding all the rows using the JBTree API, and also tried visiting all the elements and trying to use StructureViewComponent.expandPathToElement() passing in every PsiElement in the tree using a visitor, and that doesn't work.

Thanks,

Steve

0
1 comment

Please see com.intellij.ide.structureView.StructureViewModel.ElementInfoProvider and com.intellij.ide.structureView.StructureViewModel.ExpandInfoProvider to control (auto-)expansion

0

Please sign in to leave a comment.