{"id":24,"date":"2011-07-01T21:18:42","date_gmt":"2011-07-01T19:18:42","guid":{"rendered":"http:\/\/www.pellissier.co.za\/hermien\/?p=24"},"modified":"2011-07-01T21:18:42","modified_gmt":"2011-07-01T19:18:42","slug":"now-where-did-i-put-that","status":"publish","type":"post","link":"https:\/\/www.pellissier.co.za\/hermien\/?p=24","title":{"rendered":"Now where did I put that?"},"content":{"rendered":"<p>I use the search features of the NetBeans IDE a lot. I have collected thousands of pieces of useless information in my life as it is, and I am not planning to add to that memorising every line of code I have ever written. \ud83d\ude42 So I let my PC do what computers do best &#8211; search through large volumes of data. This has become an integral part of how I work, but I realised this week that not everybody knows about all the cool things you can do!<\/p>\n<p>The NetBeans IDE have a number of very useful searching features. The first, and probably most obvious, is searching through the currently selected source file. I created two new Windows in a platform application module through the wizard for illustration purposes. I opened one of the TopComponent classes in source view, and pressed Ctrl + F and typed in my search term. See the figure below.<\/p>\n<figure id=\"attachment_37\" aria-describedby=\"caption-attachment-37\" style=\"width: 717px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-021.png\"><img loading=\"lazy\" src=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-021.png\" alt=\"Searching through a source file\" title=\"nb-search-02\" width=\"727\" height=\"464\" class=\"size-full wp-image-37\" srcset=\"https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-021.png 727w, https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-021-300x191.png 300w, https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-021-624x398.png 624w\" sizes=\"(max-width: 727px) 100vw, 727px\" \/><\/a><figcaption id=\"caption-attachment-37\" class=\"wp-caption-text\">Searching through a source file<\/figcaption><\/figure>\n<p>Notice that a search bar appeared at the bottom of the editor window, where I entered my search string. And as I typed, matching words were highlighted throughout the currently selected source file. The highlighted words are also marked in the right margin \u2013 each of those lines in the margin represent a line where the search term was found. Pressing enter while the Find text box has focus, moves the selection to the next occurrence of the search term.<\/p>\n<p>If you select something in the source file before you press Ctrl + F, that text will automatically be filled in on the search panel.<\/p>\n<p>This is useful but not life changing. \ud83d\ude42 But searching, like almost everything in the IDE, is context sensitive. So by selecting a project in the projects view, and then pressing Ctrl + F again, you can access the Find in Projects feature.<\/p>\n<figure id=\"attachment_40\" aria-describedby=\"caption-attachment-40\" style=\"width: 462px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-03.png\"><img loading=\"lazy\" src=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-03.png\" alt=\"Find in Projects\" title=\"nb-search-03\" width=\"472\" height=\"350\" class=\"size-full wp-image-40\" srcset=\"https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-03.png 472w, https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-03-300x222.png 300w\" sizes=\"(max-width: 472px) 100vw, 472px\" \/><\/a><figcaption id=\"caption-attachment-40\" class=\"wp-caption-text\">Find in Projects<\/figcaption><\/figure>\n<p>Since I selected a particular project, that project is selected by default as the scope for the search. Pressing Ctrl + Shift + F instead from anywhere in the IDE, the Scope would by default be &#8220;Open Projects&#8221;.<\/p>\n<p>Let us look at the search results for the criteria &#8220;TopComponent&#8221;, searching through my module containing the two Windows.<\/p>\n<figure id=\"attachment_42\" aria-describedby=\"caption-attachment-42\" style=\"width: 715px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-04.png\"><img loading=\"lazy\" src=\"http:\/\/www.pellissier.co.za\/h\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-04.png\" alt=\"Search results\" title=\"nb-search-04\" width=\"725\" height=\"251\" class=\"size-full wp-image-42\" srcset=\"https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-04.png 725w, https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-04-300x103.png 300w, https:\/\/www.pellissier.co.za\/hermien\/wp-content\/uploads\/sites\/2\/2011\/07\/nb-search-04-624x216.png 624w\" sizes=\"(max-width: 725px) 100vw, 725px\" \/><\/a><figcaption id=\"caption-attachment-42\" class=\"wp-caption-text\">Search results<\/figcaption><\/figure>\n<p>The list shows all the files where the search criteria were matched, and for each file the list of occurrences within the file. Navigating to the location is as simple as double clicking on the entry.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I use the search features of the NetBeans IDE a lot. I have collected thousands of pieces of useless information in my life as it is, and I am not planning to add to that memorising every line of code I have ever written. \ud83d\ude42 So I let my PC do what computers do best &#8230; <a title=\"Now where did I put that?\" class=\"read-more\" href=\"https:\/\/www.pellissier.co.za\/hermien\/?p=24\" aria-label=\"More on Now where did I put that?\">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-o","_links":{"self":[{"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=\/wp\/v2\/posts\/24"}],"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=24"}],"version-history":[{"count":0,"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pellissier.co.za\/hermien\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}