Adding a structured View

I would like to add a Strutured view to my plugin.

I already have a JPanel containing a JTree with the structure. Is it possible to get this displayed for the strutured view panel?

MArk

5 comments

Hello mark,

ms> I would like to add a Strutured view to my plugin.
ms>
ms> I already have a JPanel containing a JTree with the structure. Is it
ms> possible to get this displayed for the strutured view panel?

The Structure View shown by IDEA is determined by the file type of the file
currently open in the editor. If your plugin provides a custom file type,
you can implement the StructureViewBuilder interface and return your implementation
from FileType.getStructureViewBuilder() or Language.getStructureViewBuilder.

You can find more information about these interfaces in the javadoc documentation.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

I am implementing a filetype and have a Filetype and I can already generate a tree from the structure. I have been copying the Image Viewer.

I am not clear of the practical aspects of how its supposed to be implemented - which method in which class?

Do I just add getStructureViewBuilder() to my implementation of Filetype.

MArk

0

Hello mark,

ms> I am implementing a filetype and have a Filetype and I can already
ms> generate a tree from the structure. I have been copying the Image
ms> Viewer.
ms>
ms> I am not clear of the practical aspects of how its supposed to be
ms> implemented - which method in which class?
ms>
ms> Do I just add getStructureViewBuilder() to my implementation of
ms> Filetype.

Yes. You also need to provide the implementations for StructureViewBuilder
and StructureView interfaces. FileType.getStructureViewBuilder() should return
your implementation of StructureViewBuilder, and StructureViewBuilder.createStructureView()
should return a new instance of your StructureView implementation. Your tree
should be returned from StructureView.getComponent().

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Is there a standard way to grap the focus back into the display so that when you click on an outline, it refreshes the view. editorUI.grabFocus() does not work.

And when should any nav icons at the top of the JPanel showing the view be greyed out?

MArkee

0

Please sign in to leave a comment.