StructureView Tips

Hello,

In the tree-based structure view, nodes that are grandchildren of the root seem to always have the [+] icon when the tree is built, even if the corresponding StructureViewTreeElement has no children and clicking on the [+] would have no effect other than making the [+] disappear - can this behaviour be easily changed?

In contrast, if the same nodes were one level higher (being children of the root, instead of grandchildren) they would not have the [+] icon by default.

I'm writing classes derived from TreeBasedStructureViewBuilder, TextEditorBasedStructureViewModel and StructureViewTreeElement.

2 comments

Hello Steve,

Your StructureViewModel class needs to implement StructureViewModel.ElementInfoProvider
and return correct information from the isAlwaysShowsPlus() and isAlwaysLeaf()
methods.

In the tree-based structure view, nodes that are grandchildren of the
root seem to always have the icon when the tree is built, even if
the corresponding StructureViewTreeElement has no children and
clicking on the would have no effect other than making the
disappear - can this behaviour be easily changed?

In contrast, if the same nodes were one level higher (being children
of the root, instead of grandchildren) they would not have the
icon by default.

I'm writing classes derived from TreeBasedStructureViewBuilder,
TextEditorBasedStructureViewModel and StructureViewTreeElement.


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.