1. Addon enhancements
The first update has to do with Addons. Contributing new nodes, methods and properties to builders is fairly simple, the following line is added to the plugin's install script by the create-addon command:root.'MyGriffonAddon'.addon = true
Given that addons are a natural extension to builders, and that builders can contribute methods and properties to other MVC members (like controllers for example), it follows that addons should do the same, but the syntax was not that pretty. Assuming MyGriffonAddon contributes 2 factories (foo and bar) plus an additional method (hello), this is how you would added them to a controller:
root.'MyGriffonAddon'.controller = ['foo', 'bar', 'hello']
In other words, you have to enumerate all entries that should be contributed

This is the problem addressed by this enhancement. Now you only need to write '*' to mixin all addon contributions to a particular MVC member. The previous code can be rewritten as:
root.'MyGriffonAddon'.controller = '*'
You might be thinking, what if all methods should be contributed only? This does the trick
root.'MyGriffonAddon'.controller = '*:methods'
The whole list of these new contribution qualifiers follows:
- * - all nodes, methods and properties
- *:factories - nodes only
- *:methods - methods only
- *:props - properties only
2. UIThread method shortcuts in scripts
Griffon 0.3 introduced UIThreadHelper, a handy abstraction for executing code inside/outside the UI thread, designed as a singleton. This helper class provides the following methods- isUIThread() - true if the current thread is identified as the UI thread for the current toolkit. Equivalent to SwingUtilities.isEventDispatchThread() when running Swing
- executeSync() - execute code synchronously inside the UI thread. Equivalent to SwingBuilder.edt() when running Swing
- executeAsync() - execute code asynchronously inside the UI thread. Equivalent to SwingBuilder.doLater() when running Swing
- executeOutside() - execute code outside of the UI thread. Equivalent to SwingBuilder.doOutside() when running Swing
UIThreadHelper.instance.executeSync { model.enabled = true }
Griffon 0.3.1 added shortcut versions (execSync, execAsync, execOutside, execFuture) to all MVC members and the application instance, thus allowing the following snippets to work
This update allows the shortcut methods to be used inside life cycle scripts, thus pushing down the need to call UIThreadHelper.instance directly.
3. Application phase
There's a new enum (griffon.core.ApplicationPhase) that can be used to know in which phase the application is currently is. Its values are INITIALIZE, STARTUP, READY, MAIN and SHUTDOWN; you can query it by calling getPahse() on the application instance.4. Application locale
All applications now have a bound java.util.Locale property. This means you can register PropertyChangeListeners on an application and be notified whenever their locale changes value.5. Swing enhancements
While all previous updates are applied to all applications, the following one is Swing specific (remember that Griffon can support more toolkits other than Swing via plugins).5.1 Shortcut for registering PropertyChangeListeners
Registering PropertyChangeListeners just got a bit easier, thanks to the new @Listener AST transformation. Before this enhancement you had to write the following codeBasically you were forced to register the listeners inside a constructor, you also had to cast any closures to an appropriate value. Well, not anymore. Here's the same behavior using @Listener instead
A List of property closures or inline closures is also supported as value for the @Listener annotation.
5.2 Window management
There's a new set of helper classes, WindowManager and WindowDisplayHandler that let you change the default behavior for showing and hiding windows. This new feature receives a boost from the upcoming Effects plugin. For example this is all that you have to do for enabling a dropIn/dropOut effect when showing/hiding windows1. install the Effects plugin
2. Create a class that implements WindowDisplayHandler with the following contents
3. Register an instance of this handler with the application. It can be done on a life cycle script (like Initialize or Startup) or by using an application event handler (griffon-app/conf/Events.groovy)
WindowManager is now responsible for holding a reference to all application windows that are created using the application node. This used to be the job of app.appFrames which is no longer available, developers should rely on app.windowManager.windows from now one. Windoes that were not created using the application node can still be handled by WindowManager, just call its attach() method with the window instance that should be handled.
Keep on Groovying!