Leaving NetBeans and Sun
Last week was the last one I spent on the NetBeans project and in the Sun Microsystems. I said goodbye after more than four years. I must say it was pleasure to work with all those smart people, interesting projects, vietnamese town lunches, JavaOne visits and incredible pessimism of abadea :-)
Anyway, I decided to find new cheese and I'll spend most of my time in the next months hacking server part of currently 2-tiered DB-Swing application. I'm really curious to see how I'll get used to permanent work-from-home and new server-side coding after such a long time spent mostly with the Java SE.
Now, what will happen with Groovy/Grails support in NetBeans? No worries, Petr Hejl is taking over and I must say that the code is in the best hands you could imagine. I am really looking forward NetBeans 7 (or whatever the version will be) and its Groovy/Grails features.
While speaking about Grails, I'm still wondering when the moment of disillusionment will come to me? I spent some significant time on one Grails-based web application, and 'Wow!' is still the only interjection I can use!
Groovy in NetBeans – Go To Declaration
Let's have a look at another editor feature. Often you want to navigate from one variable to its declaration which can be pages higher in the code. In that case Go To Declaration hyperlink action invoked by combination of mouse click + Command key (Mac) or Ctrl might help. In this example cursor would jump on 'list' field definition.

Groovy in NetBeans – Inplace Rename
So we are feature-frozen with NetBeans 6.5. That means no additional functionality can be added until final bits are released. We've just started fixing phase, so maybe it's time to walk through few interesting features (with screenshots, of course :-) in few more regular blog entries. For today I want to show you editor action known by several names, sometimes under Inplace Rename. On my Mac it is invoked by Ctrl+R shortcut. It tries to locate usages of local variable in edited file, highlights them and while you are editing name of the variable in one place, all other occurrences of the same variable are renamed at the same time as you type. To demonstrate this on some real example, I used HTTP POST/GET helper Groovy class from Groovy Cookbook Examples.

Groovy integration with Java SE projects
After few weeks spent on NetBeans 6.1 release I am back in development of Groovy and Grails plugin which will be official part of 6.5 release. In few following posts I will try to track progress we made recently in all the areas. Today I am covering integration with the Java SE projects. Standalone Groovy project was dropped some time ago and there was no direct replacement for a while. Now it is possible to develop your Groovy application in NetBeans Java SE project without manipulating build script and project classpath. All is done automatically when you create first Groovy class or script in the project (there is also note about that in the bottom part of the panel:
You can do the same thing in project properties panel:
What it does, should be clear from last screenshot - adds groovy-all jar on classpath, modifies IDE-controlled build script (basically wraps javac by groovyc) and excludes *.groovy files from result project's jar.
There is also groovy-all library available under Tools->Libraries once you have Groovy plugin installed:
Some work has been also done in the integration of Groovy in Java source code, thanks to work done by Tomas Zezula on Java infrastructure side. Now all Groovy classes in project behave as any regular Java classes (they appear in code completion, fix imports, etc...):
Some work still needs to be done, but don't wait, try it and provide early feedback, so we can integrate your suggestions before Milestone1.
Now on different topic - I will be in San Francisco for the JavaOne from Saturday, so if you want to discuss things personally, you can reach me there. Just send me an email at martin dot adamek at sun dot com
Update on Groovy and Grails in NetBeans
It's more then a month since I announced that we started to work on Groovy and Grails in the NetBeans. Maybe it's time to look at what's new since then and what are the next steps. Matthias Schmidt made enhancements in the Grails project support:
- Grails components wizards
- Grails shell
- Setting port for embedded Jetty server in project properties
- Setting active Grails environment in project properties
In Groovy editor Gopal Sankaran added keywords completion. I was working on some infrastructure tasks and tried to make first shots of some editor features. I made example of semantic highlighting (coloring of field declaration) and occurrences highlighting (for local variable). Now it should be pretty easy to add all other semantic highlightings and their options and also occurrences finding for all kinds of elements. I spent significant amount of time also fixing issues reported by users. That's great we have such a feedback even before we released first milestone!
Next step will be to open the door to the smart code completion and later interoperability between Groovy and Java in editor. With that in mind - I plan to drop standalone Groovy project and prefer Java SE project as main project type for Groovy development. Groovy will be extension to all NetBeans Java project types. What do you think? Is it a good step?
Btw. I am building one simple .com website in Grails and still wondering when some problem is going to happen. And still nothing. It's getting better and better every day, required changes are easy to implement, all functionality I need is provided by framework itself in some magic closure or tag, every line of Groovy code solves some business logic of my app and is so easy to read and write for poor Java guy... hmm, where's the problem?





