A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://plugins.jetbrains.com/docs/intellij/navbar.html below:

Navigation Bar | IntelliJ Platform Plugin SDK

Navigation Bar

The navigation bar implementation is used to customize and extend the navigation bar structure.

The starting point for the navigation bar extension is the NavBarModelExtension interface, which is registered in the com.intellij.navbar extension point.

To reuse the IntelliJ Platform implementation, you can extend one of two classes:

Default Navigation Bar

DefaultNavBarExtension is the basic implementation of the navigation bar for any files. Inherit from this class if you want to create a simple navigation bar where you can change the display of folders or files for your language.

In this case, you probably only need to override the following two methods:

Structure Aware Navigation Bar

StructureAwareNavBarModelExtension is an advanced implementation that provides the ability to display specific file elements (e.g., the name of classes, functions, etc.) in a bar e.g., the name of the class at the current caret position. Inherit from it if you want to add navigation bar support to your language with support for specific file elements.

Don't forget to implement Structure View, this is necessary to build a file structure model based on which the navigation bar displays a specific element.

In this case, you will also need to override the getLanguage() in addition to the two methods described earlier, this method returns the language instance for which this extension will work.

The adjustElement() method allows you to modify the navigation bar element. It can be used, for example, when you want to show a class in the navigation bar when the caret is located in a comment that is attached to the class.

You probably won't need to override other methods unless you want to write your own implementation of the entire NavBarModelExtension interface.

Note that the getSuitableClasses() method on the structure view model class that implements com.intellij.ide.structureView.TextEditorBasedStructureViewModel (see Structure View) must return all the element types you want to display in the navigation bar.

Example: Custom Language Support Tutorial: Structure Aware Navigation Bar

17 June 2025


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4