本文整理汇总了Java中com.google.gwt.event.dom.client.DomEvent.Type方法的典型用法代码示例。如果您正苦于以下问题:Java DomEvent.Type方法的具体用法?Java DomEvent.Type怎么用?Java DomEvent.Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.dom.client.DomEvent
的用法示例。
在下文中一共展示了DomEvent.Type方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setEventHandler
import com.google.gwt.event.dom.client.DomEvent; //导入方法依赖的package包/类
/**
* Sets an event handler for an {@code Element}. All previous event handlers of this type of event are removed.
* @param element The element to bind the event handler for
* @param eventType The event type (e.g. {@code ClickEvent.getType()})
* @param handler The handler that handler the event
*/
public static <H extends EventHandler> void setEventHandler(final Element element, DomEvent.Type<H> eventType, H handler) {
if (element == null) {
return;
}
HandlerManager hm = handlerManagers.get(element);
if (hm == null) {
handlerManagers.put(element, hm = new HandlerManager(element));
DOM.setEventListener(element, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
DomEvent.fireNativeEvent(event, handlerManagers.get(element), element);
}
});
}
DOM.sinkBitlessEvent(element, eventType.getName());
while (hm.getHandlerCount(eventType) > 0) {
hm.removeHandler(eventType, hm.getHandler(eventType, 0));
}
hm.addHandler(eventType, handler);
}
示例2: prepare
import com.google.gwt.event.dom.client.DomEvent; //导入方法依赖的package包/类
public void prepare() {
canvas = new GWTCanvas(width, height);
popupPanel.setWidget(canvas);
for (Entry<EventHandler, DomEvent.Type<EventHandler>> entry : eventHandlers.entrySet()) {
canvas.addDomHandler(entry.getKey(), entry.getValue());
}
}
示例3: addHandler
import com.google.gwt.event.dom.client.DomEvent; //导入方法依赖的package包/类
<H extends EventHandler> HandlerRegistration addHandler(
final H handler, DomEvent.Type<H> type) {
return addDomHandler(handler, type);
}
示例4: getAssociatedType
import com.google.gwt.event.dom.client.DomEvent; //导入方法依赖的package包/类
@Override
public final DomEvent.Type<MouseComeLeaveHandler> getAssociatedType() {
return TYPE;
}
示例5: getType
import com.google.gwt.event.dom.client.DomEvent; //导入方法依赖的package包/类
/**
* Gets the event type associated with mouse come events.
*
* @return the handler type
*/
public static DomEvent.Type<MouseComeLeaveHandler> getType() {
return TYPE;
}