Skip to content

Instantly share code, notes, and snippets.

View aalmiray's full-sized avatar
💭
🧰 building cool stuff

Andres Almiray aalmiray

💭
🧰 building cool stuff
View GitHub Profile
package b;
import java.awt.event.ActionEvent;
import org.codehaus.griffon.runtime.core.AbstractGriffonController;
public class BController extends AbstractGriffonController {
private BModel model;
public void setModel(BModel model) {
this.model = model;
package a
import org.codehaus.griffon.runtime.core.AbstractGriffonModel
class AModel extends AbstractGriffonModel {
var input: String = ""
var output: String = ""
// must make getters/setters explicit so that the Griffon runtime
// can call the appropriate method. Scala follows a non-JavaBeans
package a
import java.awt.event.ActionEvent
import org.codehaus.griffon.runtime.core.AbstractGriffonController
class AController extends AbstractGriffonController {
var model:AModel = _
// must define an explicit setter for the model property or else
// the value wont be set by the Griffon runtime
@aalmiray
aalmiray / gist:654341
Created October 29, 2010 20:27
gradle-easyb
apply plugin: 'groovy'
configurations {
easyb
}
repositories {
mavenCentral()
}
task(github) << {
println version
println "Hola mundo desde github!"
}
@aalmiray
aalmiray / gist:867629
Created March 12, 2011 22:15
Xml2Groovy
import groovy.swing.SwingBuilder
import groovy.beans.Bindable
@Singleton
class Xml2Groovy {
String parseText(String text) {
def root = new XmlSlurper().parseText(text)
ByteArrayOutputStream baos = new ByteArrayOutputStream()
IndentPrinter printer = createIndentPrinter(baos)
class SampleController {
def action1 = { ... }
def action2 = {
action1()
}
}
@aalmiray
aalmiray / gist:1239445
Created September 24, 2011 15:19
Domain class support in Griffon
@griffon.transform.Domain
class Sample {
String name
String lastName
int num
String toString() {"<$id> $name $lastName [$num]"}
}
------------------------------
After pulling from codehaus/GRIFFON_1_8_x
[javac] /Users/aalmiray/dev/github/groovy-core/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java:3627: incompatible types
[javac] found : java.lang.Object
[javac] required: T
[javac] return inject( drop( list, 1 ), head( list ), closure );
[javac] ^
// in Application.groovy
mvcGroups {
// MVC Group for "bar"
'bar' {
view = 'foo.BarView'
controller = 'foo.BarController'
}
// MVC Group for "foo"
'foo' {