ext list 使用 cti code 分割 代码 label
1. 单个委托方法的实现
- button.addActionListener({
- println'Implement ActionListener'
- }
- as ActionListener)
2. 实现接口中的多个方法:使用映射,以每个方法的名字作为键,以方法对应的代码块作为键值,使用:分割方法名和代码块
- handleFocus = [focusGained: {
- msgLabel.setText("Good to see you")
- },
- focusLost: {
- msgLabel.setText("Come back soon")
- }]
- button.addFocusListener(handleFocus as FocusListener)
Groovy 学习笔记 - 实现接口
来源: http://www.bubuko.com/infodetail-2230774.html