Add custom custom Toolbar for specific type of files


I need to add the same behaviour the Markdown plugin currently has: a custom toolbar with 3 buttons (Show editor only, Editor & Preview, Preview only).
I want to show a preview for some types of files. So far I found this JBSplitter and JBTabs which might help to implement this, but there's no example or even preview of how these components would look.

Do you know of any open source projects or samples to learn from?


Also, if a plugin already added some custom buttons for specific file types like in the screenshot below, will I be able to add additional buttons to provide my version of the preview?

1 comment
Comment actions Permalink

This implementation is specific to Markdown plugin, take a look at org.intellij.plugins.markdown.ui.split.SplitFileEditor and org.intellij.plugins.markdown.ui.preview.MarkdownSplitEditor in IJ Community Sources.

See com.intellij.openapi.fileEditor.TextEditorWithPreview for generic base class to implement split/preview editor.


Please sign in to leave a comment.