{"id":271,"date":"2012-03-23T08:29:25","date_gmt":"2012-03-23T06:29:25","guid":{"rendered":"http:\/\/www.pellissier.co.za\/hermien\/?p=271"},"modified":"2012-03-23T08:29:25","modified_gmt":"2012-03-23T06:29:25","slug":"new-java-package-view","status":"publish","type":"post","link":"https:\/\/www.pellissier.co.za\/hermien\/?p=271","title":{"rendered":"New Java Package View"},"content":{"rendered":"<p>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. \ud83d\ude42<\/p>\n<p>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.<\/p>\n<p>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 <a href=\"http:\/\/netbeans.org\/projects\/www\/lists\/netcat\/archive\/2011-10\/message\/313\">here<\/a>.<\/p>\n<p>In NetBeans 7.1, there were two options: <strong>List <\/strong>view and <strong>Tree <\/strong>view. These are accessible by right-clicking on a space in the Projects window and choosing <strong>View Java Packages as&#8230;<\/strong> from the context menu.<\/p>\n<p>The default view is <strong>List<\/strong>. Lets look at what a Java application with a number of source packages looks like in this view.<\/p>\n<figure id=\"attachment_272\" aria-describedby=\"caption-attachment-272\" style=\"width: 312px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure1.png\"><img loading=\"lazy\" src=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure1.png\" alt=\"List View\" title=\"List View\" width=\"322\" height=\"199\" class=\"size-full wp-image-272\" srcset=\"https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure1.png 322w, https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure1-300x185.png 300w\" sizes=\"(max-width: 322px) 100vw, 322px\" \/><\/a><figcaption id=\"caption-attachment-272\" class=\"wp-caption-text\">List View<\/figcaption><\/figure>\n<p>Only source packages that contain source files are shown.<\/p>\n<p>The other view that has been around for a while is the <strong>Tree<\/strong> view. Lets look at the same project, in tree view:<\/p>\n<figure id=\"attachment_273\" aria-describedby=\"caption-attachment-273\" style=\"width: 311px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure2.png\"><img loading=\"lazy\" src=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure2.png\" alt=\"Tree View\" title=\"Tree View\" width=\"321\" height=\"252\" class=\"size-full wp-image-273\" srcset=\"https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure2.png 321w, https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure2-300x235.png 300w\" sizes=\"(max-width: 321px) 100vw, 321px\" \/><\/a><figcaption id=\"caption-attachment-273\" class=\"wp-caption-text\">Tree View<\/figcaption><\/figure>\n<p>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.<\/p>\n<p>Now if you read the whole mailing list thread, you would have noticed that there was a new option that was proposed: <strong>Reduced Tree<\/strong>. And that is now available in the NetBeans 7.2 development builds! \ud83d\ude42 So lets have a look at the same project again, in the new view:<\/p>\n<figure id=\"attachment_274\" aria-describedby=\"caption-attachment-274\" style=\"width: 312px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure3.png\"><img loading=\"lazy\" src=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure3.png\" alt=\"Reduced Tree View\" title=\"Reduced Tree View\" width=\"322\" height=\"197\" class=\"size-full wp-image-274\" srcset=\"https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure3.png 322w, https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2012\/03\/packages-figure3-300x183.png 300w\" sizes=\"(max-width: 322px) 100vw, 322px\" \/><\/a><figcaption id=\"caption-attachment-274\" class=\"wp-caption-text\">Reduced Tree View<\/figcaption><\/figure>\n<p>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!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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. \ud83d\ude42 So today I was playing around with the latest development build for 7.2 (build 201203180400) and I found something small &#8230; <a title=\"New Java Package View\" class=\"read-more\" href=\"https:\/\/www.pellissier.co.za\/hermien\/?p=271\" aria-label=\"More on New Java Package View\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[3,4],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1v8WL-4n","_links":{"self":[{"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=\/wp\/v2\/posts\/271"}],"collection":[{"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=271"}],"version-history":[{"count":0,"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=\/wp\/v2\/posts\/271\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}