in class Widget,there is a method addHandler(final H handler,
GwtEvent.Type<H> type).
in a customer defined Widget which has a customer defined event,i call
the method addHandler(final H handler, GwtEvent.Type<H> type),and
transmit parameter like this:
addHandler(handler,new Type<XxxHandler>)
but the customer defined event do not take effect at all at the last.
i modified it like this: addHandler(handler,MyEvent.getType),and in
the MyEvent class:
public Type<XxxHandler> getType() {
if(type==null){
type=new Type<XxxHandler>();
}
return type;
}
now,it have no problem.
why?does it will inject the value for "type" auto automatically ?