Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@BeanProperty with PropertyChangeListener support?

@BeanProperty generates simple get/set methods. Is there a way to automatically generate such methods with support for firing property change events (e.g. I want to use it with JFace Databinding?)

like image 399
Alexey Romanov Avatar asked Nov 14 '22 10:11

Alexey Romanov


1 Answers

I've had the same question, and have been keeping a close eye out for possible answers. I think I've just stumbled across one (although I haven't tried it yet). Scala 2.9 has a feature for handling dynamic calls (meant for integration with dynamic languages, I suspect). Essentially, calls to methods which don't exist are routed to a method called applyDynamic. An implementation of that method could use reflection to check that the method signature matches a property (possibly one with an annotation similar to @BeanProperty). If there is a match, it could handle firing the event.

like image 63
Bryan Young Avatar answered Dec 09 '22 15:12

Bryan Young