Discern user and programatic updates on fields
Hi,
I'm playing a little with a little proof of concept MVC framework with Groovy and I've some doubts:
What is the best and less intrusive way to detect for example when a JFormattedTextField or TextField has changed by "program code" (listener on model for example) or by user actions (text editing...)?
For example for JFormattedTextField I can listen to the value property but then I don't know if it was modified by a listener on the model, or by user editing. And of course if it was for a listener on the model and I notify again the controller to update the model then I get a infinite cycle.
There's a way of do that without extending the JFormattedTextField or TextField? Extending it I know a solution that I think it will work:
Extend the field with a changed boolean.
When the focus enter the field clear the changed boolean
Implement a DocumentListener that updates the boolean
When the focus is lost inform the controller only if the boolean has changed.
It's a good way to do that?
Or there's better one?

