Archive

Posts Tagged ‘dialog’

Two shortcuts for NetBeans navigation

December 10, 2010 Leave a comment

NetBeans is my Java IDE of choice, and I have written about it a few times in the past.  There are a slew of features to make you more productive and today I will highlight two shortcuts that are essential to efficient navigation.  I will show you how to jump quickly to any file in any open project, and how to search for a string in any file.

Jump to any file in any open project
⌃⇧ O

Ctrl Shift O = Go to File
By typing this shortcut at any time, you launch the Go to File dialog.  This dialog allows you type pieces of any file name, and you will see results returned in near real time.  This is excellent for when you know the approximate name of the file you’re looking for (you can insert a ‘*’ character as a wildcard, so if you know the word ‘foo’ appears somewhere in the word, you would search for *foo.

Search results are returned instantly

This dialog is a great example of incremental search, a UI technique I blogged about previously.  The incremental search is beneficial because it gives you instant feedback on your search query, allowing you to modify it as necessary to find what you’re looking for.
Those of you who use TextMate might recognize this feature; in TextMate this dialog is accessible via ⌘T (Command T).
The difference is that TextMate’s search is faster, and it is more forgiving (you can search for just a few letters in the file you’re searching for and still find it; you don’t need to know the precise name).
In general it’s much faster to search for files than to navigate through the file hierarchies manually.

Search for string

The second shortcut is to search for text in all the open projects (or narrowing it down to a select few files if you prefer).  This command is easily accessible when right clicking on a project node, but it’s accessible any time via keyboard shortcut as well

⇧ ⌘ F – Find in projects
Shift Command F

This one’s pretty self explanatory, but it took me awhile to stumble onto the shortcut, and it’s a pretty helpful one to know.

I hope these two shortcuts make your time in NetBeans a little easier.