Button Bar on certain files
已回答
I would like to add split view buttons to certain file types, similar to the Markdown plugin. (Buttons are in a bar on the top of .md files, but not others, can split the window into two files) When I go to the Markdown plugin's source, the files appear to no longer be there. How do I create an action bar on a file?
请先登录再写评论。
Markdown plugin (and similar ones) do not add a toolbar/panel to the Editor.
They create whole view with two editors and replace default one (you can also keep default view, this will add tab bar at the bottom)
It can be done using `com.intellij.openapi.fileEditor.FileEditorProvider` extension point.
Markdown implementation starts here: https://github.com/JetBrains/intellij-community/blob/master/plugins/markdown/src/org/intellij/plugins/markdown/ui/preview/MarkdownSplitEditorProvider.java
See also `com.intellij.openapi.fileEditor.TextEditorWithPreview`.
Image viewer can be a simpler example of API usage https://github.com/JetBrains/intellij-community/blob/master/images/src/org/intellij/images/editor/impl/ImageFileEditorProvider.java