5.6.7 Default Imports - Reference Documentation
Authors: Andres Almiray
Version: 1.2.0
5.6.7 Default Imports
Since Griffon 0.9.1 default imports per artifacts are supported. All Groovy based artifacts will resolve classes from thegriffon.core
and griffon.util
packages automatically, there is no longer a need to define imports on those classes unless you require an static import or define an alias. An example of this feature would be as follows.class MyController { void mvcGroupInit(Map args) { println Metadata.current.'app.name' } }
Metadata
class is defined in package griffon.util
.
There are additional imports per artifact type, here's the list of default definitions
- Model
- groovy.beans -> @Bindable, @Vetoable
- java.beans -> useful for all PropertyChange* classes
- View (when using Swing)
- java.awt
- java.awt.event
- javax.swing
- javax.swing.event
- javax.swing.table
- javax.swing.text
- javax.swing.tree
META-INF/griffon-default-imports.properties
with the following format<artifact_type> = <comma_separated_package_list>
views = javax.swing., javax.swing.event., javax.swing.table., javax.swing.text., javax.swing.tree., java.awt., java.awt.event. models = groovy.beans., java.beans.