没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > groovy-swinger |
groovy-swinger
|
0 | 0 | 180 |
贡献者 | 讨论 | 代码提交 |
A try for groovier swing programming?!?Currently the original project is splitted into two sub projects: Groovy-Swinger and Groovy-Oracle. The last, Groovy-Oracle, contains some ideas to handle Oracles meta data informations. The original project, Groovy-Swinger, contains an idea to add PropertyChangeEvent handling to a naked Groovy bean.
Groovy SwingerFeature List
Add dynamic PropertyChangeListenerSupport to beans. Example: class Person
def name
def age
}
def bean = new Person(name: 'Winkler', age: 24)
GroovyPropertyChangeSupportBuilder.preparePCLMechanics(bean)
def listener = { event -> println event }
bean.addPropertyChangeListener(listener as PropertyChangeListener)
// or
bean.addPropertyChangeListener({ event -> println event })Add integration for JGoodies Data Binding. Example: // Import the classes from the sandbox...
import de.gluehloch.sandbox.groovy.bean.*
// Import JGoodies classes...
import com.jgoodies.binding.adapter.Bindings;
import com.jgoodies.binding.value.ValueModel;
GroovyPresentationModel gpm = new GroovyPresentationModel(bean)
ValueModel name = gpm.getModel('name')
ValueModel age = gpm.getModel('age')
JTextField nameTextField = new JTextField()
Bindings.bind(nameTextField, name)
JTextField ageTextField = new JTextField()
Bindings.bind(ageTextField, age)
person.setProperty("name", "Andre Winkler");
assertEquals("Andre Winkler", nameTextField.getText());There is a difference, if you call from Java the Groovy property. See at JavaCallGroovyBeanProperty.
Learning GroovyHere i try to learn the language. Example: DelegateExample
An interesting article about Groovy and a DSL: http://entwickler.de/zonen/portale/psecom,id,101,online,2154,p,0.html.