Friday, May 21, 2010

Here is a simple ShutdownHandler (available since 0.3.1) sample. For simplicity, I just made the main controller implement the new ShutdownHandler interface. All it does is to print a message during shutdown, but we can imagine that it could do much more clever things. The most interesting method is canShutdown. In this sample, it always returns true, so the application will normally shutdown. Depending on some conditions, we could make it return false, to prevent the application to shutdown.

According to one of the author of Griffon, the problem I encountered on Griffon with spaces in directories (GRIFFON-176) seems to be related to GRIFFON-156. The good news is that the bug level has been raised to critical. I hope this is going to be fixed as soon as possible. Until then, I'll use Griffon with the command line on Ubuntu only.

Thursday, May 20, 2010

I've been using Griffon on Windows with IntelliJ, and on Ubuntu with Eclipse. In order to check the changes of Griffon 0.3.1, I tried to use it on Windows command line for the first time. "griffon create-app" ended successfully, but "griffon run-app" didn't.

Base Directory: D:\temp\java\griffonsample
Running script D:\jar\griffon-0.3.1\scripts\RunApp.groovy
Environment set to development
Warning, target causing name overwriting of name default
java.lang.NoClassDefFoundError: and
Caused by: java.lang.ClassNotFoundException: and
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: and. Program will exit.

I guess it's because of my home directory being in C:\Documents and Settings\. I found a similar bug related to using space in directories, GRIFFON-156. But it's not quite the same problem, because I don't think it's related to the java.library.path variable. I think I'll report the problem.

Wednesday, May 19, 2010

Griffon 0.3.1 is out. Shutdown handlers were added, to allow to do something during the shutdown process, or to allow to abort it. Another new feature is the ability to know the running mode of the application : STANDALONE, WEBSTART or APPLET. Apart from that, the good news is that the downloadable package now contains the Griffon Guide.

Sunday, May 9, 2010

I updated Ubuntu to the latest 10.04 and the first thing I noticed is that the minimize/maximize/close window buttons were moved from the upper right corner, to the upper left corner. At first, I thought this was not a big deal. But after a few hours, it happens to be really annoying. How can I suddenly break a more than 10 years old habit ? No matter what, I keep looking for these buttons in the upper right corner. I definitely had to put them back to where they belong. How do we do that ?

Open the gconf-editor (Alt+F2 and type gconf-editor)

Search for the apps/metacity/general/button_layout key

Double click it and change it to menu:maximize,minimize,close

Click Ok, and the buttons should be back to the upper right

Another change in the default layout is that the maximize button comes before the minimize button. I didn't even notice it, so I'm fine with the current order.