One of the fun things about using the latest development builds of the NetBeans IDE is discovering the small new features that make life easier. And of course letting everybody else know about them. 🙂
So today I was playing around with the latest development build for 7.2 (build 201203180400) and I found something small but noteworthy. When working with any Java project, you are dealing with source packages in the Projects view. And there are different options for how they are displayed.
This feature was discussed in a very interesting thread on the mailing list back in NetCAT 7.1. If you are interested in reading the discussion (which includes the merits and problems associated with each option), it starts here.
In NetBeans 7.1, there were two options: List view and Tree view. These are accessible by right-clicking on a space in the Projects window and choosing View Java Packages as… from the context menu.
The default view is List. Lets look at what a Java application with a number of source packages looks like in this view.
Only source packages that contain source files are shown.
The other view that has been around for a while is the Tree view. Lets look at the same project, in tree view:
While this view may be more compact for really big projects, for smaller ones it adds a lot of effort in my opinion when you just want to switch between your packages. And that was my argument for not having the tree view as the default option.
Now if you read the whole mailing list thread, you would have noticed that there was a new option that was proposed: Reduced Tree. And that is now available in the NetBeans 7.2 development builds! 🙂 So lets have a look at the same project again, in the new view:
This is a brillaint compromise between the two views! Packages with no source files are shown a like they would have been in the list view. And the rest like the tree view. It gives you a quick to navigate view for smaller projects and still keeps the list compact for large projects. Thank you to the NetBeans team for yet another very useful improvement!