春天花会开 2012-04-06
Griffon 0.9.5 稳定版发布了,该版本修复了 RC2 的一些 bug。
Griffon 是Swing开发者的一个Groovy框架。Griffon期望提供一个稳定代码结构给Swing应用,就像Grails给web开发带来的优势一样。同 时,Griffon也可能提供一个替代应用框架,替代Spring RCP,Eclipse RCP和NetBeans平台。
示例代码:
DemoConsoleView.groovy
application(title:'DemoConsole', pack:true, locationByPlatform:true) {
panel(border:emptyBorder(6)) {
borderLayout()
scrollPane(constraints:CENTER) {
textArea(text:bind(target:model, targetProperty:'scriptSource'),
enabled: bind {model.enabled},
columns:40, rows:10)
}
hbox(constraints:SOUTH) {
button("Execute", actionPerformed:controller.&executeScript,
enabled: bind {model.enabled})
hstrut(5)
label("Result:")
hstrut(5)
label(text:bind {model.scriptResult})
}
}
}