GWT IDE Selection
I’m starting a new GWT project at work, so I wanted to select the best IDE for the job. I installed the very latest versions of these IDEs along with their respective GWT plugins:
- Eclipse 3.5 (Galileo)
- NetBeans 6.7
- IDEA 8.1
I’ll warn you right now that this is not an in-depth review or comparison. I looked just deep enough to satisfy my own curiosity and to choose a tool for my own coding.
Eclipse
Eclipse has an advantage in that Google supplies the Google Plugin for Eclipse, ensuring the plugin generates the exact same directory layout as the GWT command line tools. After installing Eclipse and the plugin, I generated a sample GWT project and it ran perfectly in hosted mode.
This is where things went badly, however. As you may know, GWT services consist of two interfaces and a class:
- MyService
- MyServiceAsync
- MyServiceImpl
For my first (and only) trick, I performed a Rename refactoring on MyService. Eclipse renamed that interface, but not the other interface or implementation class. Instead, Eclipse immediately lit up with errors, forcing me to manually rename the Async interface and Impl class. Epic fail.
NetBeans
NetBeans also supports GWT through the gwt4nb plugin. I generated a project and noted it creates a slightly different directory layout, but nothing that would introduce problems.
Like Eclipse, NetBeans failed the Rename refactoring test. Unlike Eclipse, however, NetBeans did not immediately indicate errors in the mismatched class and interface names. Thus, errors would only manifest later at runtime. I gave up very quickly.
IDEA
Unlike the other two IDEs, IDEA’s plugin does not yet support the new directory layout introduced in GWT 1.6. I initially assumed this would be a big problem, since you also see deprecation warnings when you launch your app in hosted mode.
In reality, however, the directory layout differences only manifest themselves in the output directories. The source directories are the same, so a simple Ant buildfile can produce a more standard GWT 1.7 WAR-style layout.
Of the three IDEs, IDEA is the only one to properly implement the Rename refactoring. When you rename your Service interface, the other interface and class both rename in unison.
Also, IDEA does a kick-ass job of keeping CSS styles in sync with styles referenced in GWT code. As I discovered today, when I define a style name in Java code, IDEA shows it in red and can automatically insert a new style class into my CSS file. I also refactored a <div> identifier in my HTML file, and IDEA correctly refactored the String reference in the Java source code!
Conclusion
I’ve used IDEA for years, and was initially put off by the fact that IDEA 8.1 does not yet fully support the new GWT 1.6 and 1.7 directory layout. In practice, this is a non-issue, and IDEA 9 will support the latest GWT conventions. IDEA’s first rate refactoring, along with tight integration with CSS classes and HTML identifiers really set it apart from the other IDEs.












