add to StrcuturedView? Follow
I am wondering if it's possible to at all effect the StructureTree. By that I mean extend the TreeCellRenderer (I assume exists) that renders the nodes. I would like to be able to add a button (I have a corresponding property I can access) to the enclosing panel and effect how the tree is sorted.
Basically, I want to extend the StructureView in perfectly ordinary ways.. hook into the show/hide/sort logic and represent properties through rendering.
So also with the project view (inter-package, inter-class view) . I would like to be able to display properties and have buttons associated with those properties.
Is this possible? I know for custom languages you can write your own (damn) StructureTree from scratch, but that would really be an anti-pattern when I strictly want to add functionality.
thanks!!
Message was edited by:
softwarevisualization
Message was edited by:
softwarevisualization
Please sign in to leave a comment.
The answer appears to be yes and here is the relevant API for anyone else interested. At least these classes are involved.
My own first thought is to implement a TreeBasedStructureViewBuilder by wrapping the default implementation, deferring in all cases to the wrapped method then adding custom logic as needed before returning values from each method.
http://www.jetbrains.com/idea/openapi/5.0/com/intellij/ide/structureView/TreeBasedStructureViewBuilder.html
http://www.jetbrains.com/idea/openapi/5.0/com/intellij/ide/projectView/PresentationData.html
http://www.jetbrains.com/idea/openapi/5.0/com/intellij/navigation/ItemPresentation.html
http://www.jetbrains.com/idea/openapi/5.0/com/intellij/ide/util/treeView/smartTree/TreeElement.html#getPresentation()
http://www.jetbrains.com/idea/openapi/5.0/com/intellij/ide/util/treeView/smartTree/TreeElement.html
http://www.jetbrains.com/idea/openapi/5.0/com/intellij/ide/structureView/StructureViewTreeElement.html
http://www.jetbrains.com/idea/openapi/5.0/com/intellij/ide/util/treeView/smartTree/ActionPresentation.html