I don't use gwt Widgets anymore, so I could add all custom garbage
collection and layout tasks.  Basically, anything that's going to be a root
for a bunch of other widgets with listeners can have some kind of
Stack<HandlerRegistartion>, and a function to add registrations.
Personally, I use an insterface called xHasHandlers, with public void
add(HandlerRegistration x);, a static package and class I call xVolatile,
with a public static xHasHandlers xHandleStack object so widgets in
different packages can send their listeners to their roots without knowing
any other class info.

Widgets that add Widgets with listeners should just do
xVolatile.xHandleStack = this; before creating / adding widgets.

Also, I do xVolatile.xHandleStack = this; in onLoad, so event handlers added
in onLoad will only get eaten when their parent decides to clear it's list:

@Override
public void onUnload(){
    for(HandlerRegistration x : handles)x.removeHandler();
    handles.clear();
}

-- 
"He whose desires are drawn toward knowledge in every form will be absorbed
in the pleasures of the soul, and will hardly feel bodily pleasure --I mean,
if he be a true philosopher and not a sham one." - Plato
"Wise Words Woven With Will Wakes Worlds" - Alyxandor Artistocles

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to