Java IDES - One shortcut to rule them all
Autor: Anthony Accioly | Publicado: 2013-10-08T16:38:00-03:00



"Three IDES for the Java-kings under the sky,

Seven were once famous in their halls of stone,

Plenty of others for Mortal Men doomed to die,

One shortcut to the Productivity Lord on his dark throne

In the Land of Java where the Shadows lie.

One shortcut to rule them all, One shortcut to find them,

One setting to bring them all and in the darkness bind them

In the Land of Java where the Shadows lie."

- J. R. R. Tolkien, The Lord of the Rings (slightly hacked)



I've been a polyglot programmer and multi-IDE user for several years... And as any all-arounder, I am not the most productive expert on any of them. IDES are huge beasts! It takes time to learn and to allow all of its functionality to sink in and it takes even more time to learn how to do things efficiently.&nbsp;



Memorizing highly specific keyboards shortcuts of each IDE is one of the many actives that can become tedious or even completely unachievable if you switch between IDES&nbsp;frequently. Still, all in all I do prefer this road, since every IDE has its unique qualities. I'm a huge believer of the motto "Use the right tool for the job." Quoting the amazing Abraham H. Maslow's Psychology of Science: "I suppose it is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail." Please avoid temptation!

So let's check out how to cheat and increase productivity by learning "Tool tamer" shortcuts for the most popular IDES in Javaland.







The idea behind this article is that if you can learn how to find desired functionality in the sea of options that one IDE has to offer, then you can teach yourself to be more productive with it. If you can configure all of your IDES to use the same shortcut to access the desired functionality then congratulations, you have just created a shortcut to rule them all.



Eclipse


If you make a living out of Java, chances are that you have spent some time with Eclipse, either because you love it or because that's what everyone else in your company uses! Eclipse is the only IDE that an entire army of (not that enthusiastic) Java Developers have ever learned how to use: it often offers the only best third-party plugins for a certain software stack. Eclipse is the most popular IDE in Javaland. Developed by an impressive foundation - backed by a giant group of technology companies and fueled by a vibrant community - the extremely customizable SWT-based IDE conceived by IBM isn't going away anytime soon.



If you don't know how to do something in Eclipse, just resort to the handy Quick Access functionality (Ctrl+3) and type the desired action  (say, "Extract Variable").






If you don't like Ctrl+3 just bind the Quick Access command to some other key combination. In order to do this follow these steps:




Navigate to Windows → Preferences
In the right menu open General → Keys
Locate and select Quick Access
Change its binding to the desired key combination
Click on Apply and OK




&nbsp; 












Netbeans


"The only IDE you need" was the Netbeans motto back when Sun shined. It is intriguing to observe how &nbsp;a lot of my colleagues dismiss this very crafty IDE as "slow"... This might have been true once upon a time when Netbeans hadn't yet reached its fourth release, the VMs were not optimized for Swing Applications, and computers were shipped with way less memory and very poor graphic cards. Nowadays Netbeans is a very responsive IDE with amazing UI Design Tools (JavaFX anyone?), a great out-of the-box experience for Java SE and Java EE, out-of-the-box support for a variety of Java tools and frameworks, plus a surprisingly competent out-of-the-box support for other programming languages (such as PHP, Groovy and C/C++). Netbeans surely lives up to its motto, and does this with a clean, hassle-free philosophy which makes it the perfect IDE to use in classroom.

Much in the same fashion of Eclipse, Netbeans exposes a Quick Find command which can be triggered with Ctrl+l. Although unlike Eclipse, Netbeans tries to find a lot of things by default (Types, Symbols, Help references, Maven artifacts and so on). So if your goal is to find an IDE functionality it is advisable to narrow the search category (accessible with Shift+F10 when the cursor is on the search bar) to Action.







I have never really liked Ctrl+l as a shortcut to Quick Find. So Thanks Sun for shortcut customization. To change your keymap, do the following:

Navigate to Tools → Options
Click twice on the Keymap button located at the top Toolbar 
Look for "Quick search"
Click in the Shortcut cell (or on the small ellipsis button) to edit
Type your new key combination
Click on OK









IntelliJ IDEA


How does a company make money out of a Java IDE when programmers can just download very good IDES such as Eclipse and Netbeans for free? Easy, you make the best tool on the market! And that's exactly what JetBrains did with IntellliJ IDEA. But don't take my word for it: just read what Martin Fowler has to say about IntelliJ (in its way, Martin Fowler is the IT version of Tom Hanks, we can always borrow its credibility). While there is a free Community Edition (which is good enough to run the amazing Scala Plugin, light years ahead of the competition) the good stuff comes with a price tag.
Is it worth it? Sure! I think that IntelliJ is indeed the Best Java and Polyglot IDE there is. I feel that developing with IntelliJ is a pleasure. Yes, I think that it can read my mind. And yes, I'm sold. But no, I'm not on commission, although if someone at Jetbrains ever reads this article and feel like donating a lifetime IntelliJ license, I'm all for it!

God is in the detail!&nbsp; And IntelliJ Find Actions command has a very different (and, in my option, way better) approach for searching actions than Eclipse and Netbeans top right corner search boxes... Ctrl+Shift+a makes IntelliJ pop up a contextual menu right in the middle of your code. Easy, fast and to the point.







If Ctrl+Shift+a stresses your fingers (or your brain), no problem - here is the receipt to change it:

Navigate to File → Settings
At the left menu click on Keymap
Look for "Find action"
Click twice on it to customize the shortcuts
Click on Apply and OK






And that's all: you've learned how to find your actions and teach yourself new shortcuts using three of the most popular Java IDES. Plus you have mastered how to customize key bindings according to your desires. Now come on, don't be a Hobbit (or eight Hobbits, also know as a Hobbyte)! Use the precious shortcut... Rule them all!