Thursday, April 22, 2010

IntelliJ IDEA 9.0.2

IntelliJ IDEA 9.0.2 is out. The list of improvements is here. Things I'm going to have a look at are the database access improvements and the UML-like diff tool. Well unless that annoying bug is still there... After some research, that bug was already reported as bug IDEA-23472.

I tried the database console, using a locale PostgreSQL database.
I wonder if we can copy/paste the result of the SQL query, including the column names.

Tuesday, April 20, 2010

SyntaxHighlighter in Blogger

As I plan to post code in my blog, I searched for a way to use the SyntaxHighlighter library. There are some good installation explanations here.
System.out.println("Great!");

Monday, April 19, 2010

IDE under Ubuntu

I had Ubuntu 9.4 for a while on my laptop, but I was not using it much. I can't tell why. Recently, after spending some time trying to remember which password I was using, I decided to go back to it. I upgraded to 9.10, installed Compix Fusion and Awn, and start playing with all sorts of configurations. Compix is crazy ! If you decide to install Ubuntu, you have to try it. Ubuntu is a lot of fun, and it's fast ! Booting is fast, launching applications is fast. I can't come back to Windows without getting frustrated by the time I have to wait until I can launch an application.

Until now, I was using both IntelliJ and Eclipse on Windows. The first thing I did was to install both on Ubuntu. After setting a few environment variables, I started IntelliJ. It worked. It worked very well. I made a new Griffon project, and started some coding. I like IntellJ's Griffon view, with the Model, View and Controller folders. It was fun... until the focus cursor went wild. No more focus. No matter where I clicked, the window was not responding to the keyboard anymore. After restarting IntelliJ, everything was back to normal. But then the focus cursor went wild again. I searched the web for similar problems, and it seems that many people have this problem on Ubuntu. After wasting some time trying some of the suggestions I read, I gave up, and turned back to Eclipse.

Eclipse Gallileo works like a charm. CTRL+Space was already mapped to the Input Method Editor(IME), so I just had to change the IME settings and remove CTRL+Space from the hook list. Apart from that, I haven't encountered any particular inconvenience yet.

Friday, April 16, 2010

Discovering Griffon



 According to Griffon's homepage,

Griffon is a Grails like application framework for developing desktop applications in Groovy. Inspired by Grails, Griffon follows the Convention over Configuration paradigm, paired with an intuitive MVC architecture and a command line interface. Griffon also follows the spirit of the Swing Application Framework (JSR 296), it defines a simple yet powerful application life cycle and event publishing mechanism.

Why should I be interested in Griffon ? First of all, the project I've been working on for several years is based on Swing. Swing's pitfalls and inconveniences are no secret anymore, so I was curious to know how Griffon could help in developing Swing applications. Another reason is that I have never used Groovy yet, so I found this was a good opportunity to hit two birds with one stone, learning both Groovy by using Griffon.

I heard about the book Griffon In Action at JavaRanch, and decided to give it a try. The book, edited by Manning, is still in its MEAP phase, so only a few chapters are available. The chapters I have read so far are very interesting, and I was amazed by the way we could use Groovy and Griffon to develop Swing applications in a breeze.

I like the way the Model, View, Controller can access each other via implicit injections, and the way the Model gets bound to the View's components. Much easier than trying to access Swing's JFrame components. I also like the way the View is constructed with Groovy, although I wonder how messy this might become if we try to make screens made of a lot of components. I will have to spend some time trying to use Abeille Forms to make more complex screens.

Swing's Event Dispatcher Thread (EDT) is something we have to be particularly aware of, and this is no exception when using Griffon. But making things run in or out of the EDT is made somewhat simple via the SwingBuilder and its "edt" related methods.

I doubt that I will ever use Griffon at work, but I think it's still worth studying. I will try to illustrate some of Griffon's features in other posts.