GWT Horizontal Events Panel

Have you wanted to add event observation/Listening handlers to a panel? This is and easy way to observe events in a GWT HorizontalPanel. Gwt 1.6, 2.0, 2.01, 2.02, 2.03+...

// easy extend and observe mouse events on a gwt horizontal panel widget
public class HorizontalEventPanel extends HorizontalPanel implements HasMouseOverHandlers, HasMouseOutHandlers {

public HorizontalEventPanel() {
sinkEvents(Event.MOUSEEVENTS);
}

public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
return addDomHandler(handler, MouseOverEvent.getType());
}

public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
return addDomHandler(handler, MouseOutEvent.getType());
}
}
Post a Comment

Popular posts from this blog

How to Get Date/Time in/with GWT

Encoding URL delimiters (for GWT)