Bạn có thể thực hiện chúng như thế này:
public class MyWidget extends Composite implements HasAllMouseHandlers, HasClickHandlers {
...
public HandlerRegistration addClickHandler(ClickHandler handler) {
return addDomHandler(handler, ClickEvent.getType());
}
public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
return addDomHandler(handler, MouseDownEvent.getType());
}
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return addDomHandler(handler, MouseMoveEvent.getType());
}
public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
return addDomHandler(handler, MouseOutEvent.getType());
}
public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
return addDomHandler(handler, MouseOverEvent.getType());
}
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
return addDomHandler(handler, MouseUpEvent.getType());
}
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
return addDomHandler(handler, MouseWheelEvent.getType());
}
}
Để có được phụ tùng d'bạn n'd làm việc, thấy điều này http://groups.google.com/group/gwt-dnd/browse_thread/thread/85039aaa229d53cf/f5ad10ff9a37ab9d?lnk=gst&q=custom+widget#f5ad10ff9a37ab9d
Nguồn
2009-12-28 13:15:14
Thanks for ur trả lời :) nó đã giúp tôi rất nhiều .. – sindhu
Tuyệt vời! Nó làm việc như một say mê! – GingerHead