Wednesday, April 7, 2010

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());
}
}

No comments:

Trying out the Dart Analysis Server

I wanted to see how the Dart Analysis Server was put together and worked. I started looking to see how I could wire it up and try out the co...