Java class browser Follow
Hi all,
Sorry if it's a obvious question...
I'd like to create a custom Java structure browser and put it in a tool window.
To do it I think that I have to extend the class TreeBasedStructureViewBuilder, but I don't know how to start. I'm using a editor based on StrutsGraphEditor and like to show the (custom) Java class structure when the file is opened.
What I have to do?
Thanks,
Andre
Please sign in to leave a comment.
Hi,
I think following will answer your quries -
FileEditor fileEditor = (FileEditor) e.getDataContext().getData(DataConstants.FILE_EDITOR);
StructureViewBuilder structureViewBuilder = fileEditor.getStructureViewBuilder();
StructureView structureView = structureViewBuilder.createStructureView(fileEditor, editor.getProject());
StructureView will contain the Java class structure.
Thanks
Arnab
Arnab,
Thank you for your response. As a new intellij develeper, I don't know where to put this code. I don't want to use an action, but show the StructureView when a file is opened for edition.
Can I put this code in a PerspectiveFileEditor or any similar class? where?
Thanks again,
Andre