Learn that the single most important window after the editor is the project window. This is where you’ll manage your project’s files and folders, but it’s also where you can see the structure of the project broken down in a variety of ways.
- The single most important window after the editor is the project window. This is where you manage your projects files and folders, but it's also where you can see the structure of the project broken down in variety of ways. As I described before, the project window header has a list of what are known as Scopes. The default scope is called, the Project scope, and it displays your files and folders in a tree exactly as they're stored in your file system. The other scopes though, filter and reorganize the files and folders as needed. For example, the Packages scope, shows you just your classes and they're organized in packages.
You can change the way your packages are displayed. By default, empty packages are compacted, flattened, so you only see a tree note for packages that actually have something in them. You can change this behavior by clicking on the settings icon, that's the gear, and deselect, Hide Empty Middle Packages. And now you'll see all of the packages, even if they're empty. To return to the compacted view, go back to the menu and select that item again. The Project Files scope, filters your files so you're only seeing your source code files and then anything that has to do with managing the project.
You'll see the iml file, which is the project management file. And the idea folder, which also contains a number of configuration files. The Problems scope doesn't show any actual files and folders as long as your code is intact. But the instant you make a mistake in your code, for example, I'll remove a semicolon here, that will appear in the problem scope. You can drill down to the file, that has the problem, and when you double click on it, that will open the file itself. I'll close all of my files and demonstrate that again, and when I double click, I'll open to the class.
Now, notice, you aren't jumping to the actual place where the problem is. To do that, press the F2 key, and you'll be moving from one warning or error to the next. This file only has one warning or error, so I only go to one place. I'll put the semicolon back in, and then press F2 again, and I see the message is, "No errors found in this file". The Production scope is similar to the Project scope, in that, it displays the actual file and folder organization on disc, but it doesn't show generated folders, such as the out directory.
If you're doing test driven development, there are a number of scopes for testing, and then there's a scope called Scratches. This is where you'll see your scratch files. Temporary files that you can create, that aren't actually a part of the project itself, but instead are connected to your user profile. I'll describe these scratch files in depth in another video. So those are the different scopes that are available in the project window. Typically use either the Project scope or the Packages scope. The Packages scope is especially helpful when you're working on an application that's pure java, and doesn't have any other resources involved.
- Exploring IntelliJ IDEA editions
- Installing IntelliJ IDEA on macOS and Windows
- Configuring IntelliJ IDEA
- Creating new projects
- Importing an Eclipse project
- Exploring the user interface
- Editing and debugging code
- Building, compiling, and packaging Java projects
- Managing multiple branches with Git
- Programming with Groovy, Scala, and Kotlin