If you are willing to wait till 2.1 or upgrade to the milestones addHandler has been changed to public instead of protected.
On Sep 28, 4:40 pm, drthink <[email protected]> wrote: > I want to add a click handler to a panel so I extended the > HorizontalPanel as shown below. It feels dirty because in the > constructor I have to register the click event but put nothing in the > method in order for the ClickEvent to propgate to the parent control > which registers the ClickHandler. Is this the correct way of doing it > or am I being a hacker? > > Cheers > G > > public class HorizontalPanelSoho extends HorizontalPanel implements > HasClickHandlers { > > public HorizontalPanelSoho(){ > super(); > this.addDomHandler(new ClickHandler(){ > > @Override > //This has to be here otherwise event doesn't get > passed up to the > handler registered. > public void onClick(ClickEvent event) { > } > > }, ClickEvent.getType()); > } > > @Override > public HandlerRegistration addClickHandler(ClickHandler handler) { > return addHandler(handler, ClickEvent.getType()); > } > > } -- 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.
