# File structure

> **TL;DR**
> The Structure tool window: `View | Tool Windows | Structure` or `Alt+7` (Windows), `⌘ 7` (macOS), `⌘ 7` (IntelliJ IDEA Classic (macOS)), `⌘ 7` (macOS System Shortcuts), `Alt+7` (XWin), `Alt+7` (GNOME), `Alt+7` (KDE), `Alt+7` (Emacs), `Alt+7` (Sublime Text), `⌘ 7` (Sublime Text (macOS)), `Ctrl+7` (NetBeans), `Ctrl+Alt+F` (Visual Studio), `⌃ ⌥ F` (Visual Studio (macOS)), `Alt+7` (Eclipse), `⌘ 7` (Eclipse (macOS))
>
>
>
> The Structure popup: `Navigate | File Structure` or `Ctrl+F12` (Windows), `⌘ F12` (macOS), `⌘ F12` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ 7` (macOS System Shortcuts), `Ctrl+F12` (XWin), `Ctrl+F12` (GNOME), `Ctrl+0` (KDE), `Ctrl+F12` (Emacs), `Ctrl+R` (Sublime Text), `⌘ R` (Sublime Text (macOS)), `Ctrl+F12` (NetBeans), `Alt+\` (Visual Studio), `⌥ \` (Visual Studio (macOS)), `Ctrl+F3` (Eclipse), `⌘ O` (Eclipse (macOS))

IntelliJ IDEA allows you to view and navigate the structure of a file in the [Structure](#structure-tool-window) tool window and in the [Structure](#structure-popup) popup.

Structure popup:

![Structure popup](https://resources.jetbrains.com.cn/help/img/idea/2026.2/file-structure-popup.png)

Structure tool window:

![Highlighting changes in files](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ij_color_status_in_structure.png)

You can see the [VCS status colors](adding-files-to-version-control.html#file_status) in the  Structure  tool window and the Structure  popup if your project is under [version control](version-control-integration.html). It helps you track changes in files. The names of modified objects become blue, and the names of the newly added objects appear highlighted in green.

Hover over icons in Structure to get additional information in tooltips about the items. For example, you can learn whether methods ![Method](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.nodes.method.svg) are static.

## Structure popup

The popup provides less information than the [tool window](#structure-tool-window), but it allows you to navigate the structure faster due to the [Narrow down on typing](#narrow-down-typing) option.

Procedure:

1. Open a file in the editor and press `Ctrl+F12` (Windows), `⌘ F12` (macOS), `⌘ F12` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ 7` (macOS System Shortcuts), `Ctrl+F12` (XWin), `Ctrl+F12` (GNOME), `Ctrl+0` (KDE), `Ctrl+F12` (Emacs), `Ctrl+R` (Sublime Text), `⌘ R` (Sublime Text (macOS)), `Ctrl+F12` (NetBeans), `Alt+\` (Visual Studio), `⌥ \` (Visual Studio (macOS)), `Ctrl+F3` (Eclipse), `⌘ O` (Eclipse (macOS)), or go to `Navigate | File Structure` in the main menu.

2. In the popup, start typing the name of the element that you want to find. The IDE will narrow down the search results as you type.

You can also use [CamelHumps](null) , that is, for example, you can type `dsu`  to match  .

3. You can additionally narrow down your search results by using the checkboxes in the popup. To change the sorting, click ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.settings.svg) and select the necessary option.

4. Press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)) or click an item to close the popup and navigate to the selected element in the editor.

![Structure popup](https://resources.jetbrains.com.cn/help/img/idea/2026.2/file-structure-popup-menu.png)

Inherited members
: Displays all methods and fields inherited by the current class and accessible from it. The inherited members are displayed gray to distinguish them from the members defined in the current class.

Anonymous Classes
: Displays inner anonymous classes in the tree view.

Lambdas
: Displays all lambdas in the tree.

Alphabetically
: Sorts elements within a class alphabetically.

By Visibility
: Sorts items by their visibility in the following order: public - protected - package local - private .

Narrow down on typing
: Hides irrelevant items [as you type](speed-search-in-the-tool-windows.html). When this option is disabled, the IDE highlights all items that match your search query without hiding irrelevant items.

## Structure tool window

Procedure:

1. Open a file in the editor or select it in the  Project tool window .

2. Press `Alt+7` (Windows), `⌘ 7` (macOS), `⌘ 7` (IntelliJ IDEA Classic (macOS)), `⌘ 7` (macOS System Shortcuts), `Alt+7` (XWin), `Alt+7` (GNOME), `Alt+7` (KDE), `Alt+7` (Emacs), `Alt+7` (Sublime Text), `⌘ 7` (Sublime Text (macOS)), `Ctrl+7` (NetBeans), `Ctrl+Alt+F` (Visual Studio), `⌃ ⌥ F` (Visual Studio (macOS)), `Alt+7` (Eclipse), `⌘ 7` (Eclipse (macOS)) or go to `View | Tool Windows | Structure` in the main menu.

3. In the tool window, [start typing](speed-search-in-the-tool-windows.html) the name of the element that you want to find. You can also use CamelHumps. The IDE will highlight the search results as you type.

4. You can additionally narrow down your search results or sort the items in the tool window by using the options located under ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.show.svg).

![Structure tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/structure-java-tool-window.png)

### View options

#### Sort

Alphabetically
: Sorts elements within a class alphabetically.

By Visibility
: Sorts the items by their visibility in the following order: public - protected - package local - private.

> **Tip:**
> When both options are enabled, the items in the view are grouped according to their visibility levels. Within each visibility level group, the items are sorted alphabetically. When both options are disabled, the items are shown in the order they appear in the code.

#### Show

Anonymous Classes
: Displays inner anonymous classes in the tree view.

Fields
: Displays all fields (properties) in the tree.

Inherited
: Displays all methods and fields inherited by the current class and accessible from it. The inherited members are displayed gray to distinguish them from the members defined in the current class.

Lambdas
: Displays all lambdas in the tree.

Non-public
: Displays all non-public class members.
:
:
:
: Turn the option off to hide all non-public members.

HTML Outline
: (Only for HTML files) Displays HTML 5 outline of an HTML file

DDL statements
: (Only for SQL files) Displays only DDL statements (for example, `CREATE`, `ALTER`, `DROP`, and other statements).

DML statements
: (Only for SQL files) Displays only DML statements (for example, `SELECT`, `INSERT`, `UPDATE`, `DELETE`, and other statements).

Select statements
: (Only for SQL files) Displays only `SELECT` statements.

Other
: (Only for SQL files) Displays only statements that do not fall under the previous categories.

#### Group

Methods by Defining Type
: Groups all methods that override or implement the methods of a particular class or interface under the node that corresponds to this class or interface.

Properties
: Displays getters, setters, and fields in the tree.

Group by type
: (Only for SQL files) Group statements by their type (for example, DDL statements, DML statements, `SELECT` statements, and Other).

### Run code from the Structure tool window

The Structure tool window allows you to [run](running-applications.html) and [debug](debugging-code.html) your code.

Procedure:

* Right-click a runnable method in the Structure tool window and select ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.gutter.run.svg) Run 'method name' (`Ctrl+Shift+F10` (Windows), `⌃ ⇧ R` (macOS), `⌃ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ R` (macOS System Shortcuts), `Ctrl+Shift+F10` (XWin), `Ctrl+Shift+F10` (GNOME), `Ctrl+Shift+F10` (KDE), `Ctrl+Shift+F10` (Emacs), `Ctrl+Shift+F10` (Sublime Text), `Ctrl+Shift+F10` (Sublime Text (macOS)), `Alt+Shift+F6` (NetBeans), `Ctrl+Alt+F5` (Visual Studio), `⌃ ⌥ F5` (Visual Studio (macOS)), `Ctrl+Shift+F10` (Eclipse), `⌃ ⇧ R` (Eclipse (macOS))) or ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.run.debug.svg) Debug 'method name' (`⌃ ⇧ D` (Windows), `⌃ ⇧ D` (macOS), `⌃ ⇧ F9` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ D` (macOS System Shortcuts), `⌃ ⇧ D` (XWin), `⌃ ⇧ D` (GNOME), `⌃ ⇧ D` (KDE), `⌃ ⇧ D` (Emacs), `⌃ ⇧ D` (Sublime Text), `⌃ ⇧ D` (Sublime Text (macOS)), `Ctrl+Shift+F5` (NetBeans), `⌃ ⇧ D` (Visual Studio), `⌃ ⇧ D` (Visual Studio (macOS)), `⌃ ⇧ D` (Eclipse), `⌃ ⇧ D` (Eclipse (macOS))).

Procedure: Run tests from Structure

In the [Structure tool window](#structure-tool-window), you can select one or several test methods in a class to run. In this case, the IDE also creates a temporary run configuration with these methods that you can [save](run-debug-configuration.html#save-as-permanent) and edit.

1. In the Structure tool window, right-click one or several test methods and select ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.gutter.run.svg) Run 'method name' (`Ctrl+Shift+F10` (Windows), `⌃ ⇧ R` (macOS), `⌃ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ R` (macOS System Shortcuts), `Ctrl+Shift+F10` (XWin), `Ctrl+Shift+F10` (GNOME), `Ctrl+Shift+F10` (KDE), `Ctrl+Shift+F10` (Emacs), `Ctrl+Shift+F10` (Sublime Text), `Ctrl+Shift+F10` (Sublime Text (macOS)), `Alt+Shift+F6` (NetBeans), `Ctrl+Alt+F5` (Visual Studio), `⌃ ⌥ F5` (Visual Studio (macOS)), `Ctrl+Shift+F10` (Eclipse), `⌃ ⇧ R` (Eclipse (macOS))).

![Run code from the tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/run-from-structure2.png)

The tool window allows you to add test methods to an existing run configuration (for JUnit and TestNG tests) in which the test scope is specified by means of a [pattern](run-debug-configuration-junit.html#testKind). You can add methods from several different classes creating a test suite.

2. Right-click a method in the Structure tool window and select:

* Add to temp suite: <Configuration_name> if there is only one configuration with the Pattern test scope.

* Add to JUnit Pattern Suite (JUnit) / Add to Temp Suite (TestNG) if there are several configurations with the Pattern test scope. In this case, a popup appears in which you can select the target configuration.

![Run code from the tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/run-from-structure.png)

## Group members

In Java , you can group class members in Structure by annotating them in your source code.

Procedure:

* In the editor, select a code fragment and press `Ctrl+Alt+T` (Windows), `⌘ ⌥ T` (macOS), `⌘ ⌥ T` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ T` (macOS System Shortcuts), `Ctrl+Alt+Shift+B` (XWin), `Ctrl+Alt+Shift+B` (GNOME), `Ctrl+Alt+Shift+B` (KDE), `Ctrl+Alt+T` (Emacs), `Ctrl+Alt+T` (Sublime Text), `⌘ ⌥ T` (Sublime Text (macOS)), `Ctrl+Alt+T` (NetBeans), `Ctrl+Alt+T` (Visual Studio), `Ctrl+Alt+T` (Visual Studio (macOS)), `Alt+Shift+Z` (Eclipse), `⌘ ⌥ Z` (Eclipse (macOS)) or go to `Code | Surround With` in the main menu. Select the necessary folding region comment, `region` or `editor-fold`.

IntelliJ IDEA inserts the comments around the selected code. Learn more from [Surround code fragments](surrounding-blocks-of-code-with-language-constructs.html).

The Structure tool window and Structure popup mark these regions with ![Custom region](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.nodes.customRegion.svg).

![Custom folding region](https://resources.jetbrains.com.cn/help/img/idea/2026.2/custom_region_in_structure.png)

## Show members in the Project tool window

Procedure:

* In the Project tool window `Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+1` (NetBeans), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS)), click ![Options](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.moreVertical.svg) in the header and select `Appearance | Members`.

![Show class members in the Project tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/show_members.png)

## Logical structure

For Spring and Jakarta EE classes, JPA entities, and Liquibase changelogs, IntelliJ IDEA provides advanced insights into the file structure, displayed in two tabs:

* The Physical tab represents class methods and fields, similarly to regular Java classes, and allows you to sort, group, and quickly search them.

* The Logical tab illustrates the file structure from the framework point of view. It helps you understand the purpose of your file and its components in your project and shows meaningful connections with other pieces of the application. The tab displays the following: * For Spring classes: * Autowire relationships * Auto-configuration classes for the main Spring application class * Endpoints with HTTP methods and URL mappings for Spring controllers * Entities for Spring repositories. The repository methods are grouped by `find`, `count`, `modify`, and `delete` operations. * Scopes for Spring beans and services * Beans and imports for Spring configuration classes * Database column mappings for JPA, Spring Data JDBC, Spring Data MongoDB documents, and Exposed entities (also supported in [Persistence tool window](persistence-tool-window.html)). * Jakarta Beans: injections, producer methods and fields, JAX-RS endpoint mappings * Jakarta Data Repositories: entities, injects, and methods * [Liquibase changesets](liquibase.html#liquibase-structure-tool-window)

Logical:

![Logical structure](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_class_logical_structure.png)

Physical:

![Logical structure](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_class_physical_structure.png)

