Overview
Griffon 0.9.4 – "Aquila kienerii" - is a maintenance release of Griffon 0.9.
New Features
Buildtime
Specify source encoding
It's now possible to specify a source encoding for files
during compilation. Specify
griffon.source.encoding either as a System property
or inside
BuildConfig.groovy /
settings.groogy
Runtime
Eager instantiation of Services
Services will be lazily instantiated unless the following flag
is set to true in
Config.groovy.
Service handling
All services instances will become available through an
instance of type
griffon.core.ServiceManager. This helper class
exposes available services via a Map. You can query all currently
available services in the following manner
You can also query for a particular service instance in the following way
It's worth mentioning that the previous method will instantiate the service if it wasn't available up to that point.
Identify the top node in a secondary View script
Most of the times a View script defines a single node. This node is set as the return value of the script, which is useful for composing secondary Views by calling the build() method on the primary View.
However, there may be times where the "root" node is not the last expression evaluated in the script (due to additional configuration like bindings or setting up listeners for example). In this case the developer must set a reference to the top node and make an explicit return at the end of the script.
There's a new node called
root() that can either identify or grant access to
the top level node of a View script depending on the usage
mode.
Secondary view script (assuming class name is Secondary)
Primary view script
Custom managers
Developers are now able to define the type of
griffon.core.ArtifactManager,
griffon.core.AddonManager and
griffon.core.MVCGroupManager to be instantiated if
the default one is not suitable for their needs. A set of
matching factories can be found in the
griffon.core.factories package. A developer must
configure the chosen factory in
Config.groovy. For example
Breaking Changes
Runtime Behavior
All variants of the method
griffon.core.MVCGroupHandler.buildMVCGroup no longer
return a Map with all MVC members keyed by type. They now return
an instance of
griffon.core.MVCGroup.
The following application events have changed their parameters:
|
Event |
Params |
|---|---|
|
InitializeMVCGroup |
MVCGroupConfiguration config, MVCGroup group |
|
CreateMVCGroup |
MVCGroup group |
|
DestroyMVCGroup |
MVCGroup group |
Applications no longer have a dynamic method
Dependencies
New versions for the following dependencies
- Groovy 1.8.2
Sample Applications
Griffon 0.9.4 ships with 5 sample applications of varying levels of complexity demonstrating various parts of the framework. In order of complexity they are:
File Viewer
File Viewer is a simple demonstration of creating new MVCGroups on the fly.
Source: samples/FileViewer
To run the sample from source, change into the source
directory and run
griffon run-app from the command prompt.
GroovyEdit
GroovyEdit is an improved version of FileViewer that uses custom observable models.
Source: samples/GroovyEdit
To run the sample from source, change into the source
directory and run
griffon run-app from the command prompt.
Font Picker
Font Picker demonstrates form based data binding to adjust the sample rendering of system fonts.
Source: samples/FontPicker
To run the sample from source, change into the source
directory and run
griffon run-app from the command prompt.
Greet
Greet, a full featured Griffon Application, is a Twitter client. It shows Joint Java/Groovy compilation, richer MVCGroup interactions, and network service based data delivery.
Source: samples/Greet
To run the sample from source, change into the source
directory and run
griffon run-webstart from the command prompt.
Because Greet uses JNLP APIs for browser integration using
run-app will prevent web links from working.


