All,
There has been a fair amount of discussion about the 1.6 HandlerManager and
related code, along with a few issues submitted (primarily by Ed), and I'm
starting this thread to try and reach some kind of consensus on what, if
anything, needs to be changed about it. Please note that we need to find the
simplest things we can do to enable everyone's use cases, without creating a
new event system from whole cloth, or adding a lot of complexity to simple
use cases. Please help me to reach convergence so that we can get this taken
care of reasonably soon.
The following are the three issues I'm aware of. I'll work backwards, from
simplest to most complex.
1. Switching the 'source' of an event object, primarily for composite
events.
We actually did consider this in the original design. This is the normal
pattern for re-firing an event from a composite (the composite has a field
called 'button' that represents a wrapped widget):
HandlerRegistration addClickHandler(ClickHandler h) {
return button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
fireEvent(event);
}
});
}
This does require the instantiation of an extra inner class, but the design
allows the HandlerManager to re-use event objects, even when they're fired
through multiple layers of widgets and composites.
2. Making the source of a HandlerManager generic (issue 3636).
Mark Renouf's comment in this issue was spot on: Doing so would break the
delegation described above. I don't see any way around this. Please let me
know if I've missed something (but please no proposals that would involve
redesigning the whole event system).
3. Adding an "interceptor" to the HandlerManager (issue 3628).
I'll be honest. I've spent all morning trying to figure out what's being
requested here, and I just don't quite get it. I'm sure there's a real
problem being described here, but I think I need a very concrete use-case
that can't be easily implemented the way things are to fully understand it.
Thanks for your help,
joel.
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---