com.google.gwt.user.client.ui.Widget.ensureHandlers()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中com.google.gwt.user.client.ui.Widget.ensureHandlers()方法的一些代码示例,展示了Widget.ensureHandlers()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.ensureHandlers()方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.Widget
类名称:Widget
方法名:ensureHandlers

Widget.ensureHandlers介绍

[英]Ensures the existence of the handler manager.
[中]确保处理程序管理器的存在。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Adds this handler to the widget.
 *
 * @param <H> the type of handler to add
 * @param type the event type
 * @param handler the handler
 * @return {@link HandlerRegistration} used to remove the handler
 */
public final <H extends EventHandler> HandlerRegistration addHandler(
  final H handler, GwtEvent.Type<H> type) {
 return ensureHandlers().addHandler(type, handler);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * For <a href=
 * "http://code.google.com/p/google-web-toolkit/wiki/UnderstandingMemoryLeaks"
 * >browsers which do not leak</a>, adds a native event handler to the widget.
 * Note that, unlike the
 * {@link #addDomHandler(EventHandler, com.google.gwt.event.dom.client.DomEvent.Type)}
 * implementation, there is no need to attach the widget to the DOM in order
 * to cause the event handlers to be attached.
 *
 * @param <H> the type of handler to add
 * @param type the event key
 * @param handler the handler
 * @return {@link HandlerRegistration} used to remove the handler
 */
public final <H extends EventHandler> HandlerRegistration addBitlessDomHandler(
  final H handler, DomEvent.Type<H> type) {
 assert handler != null : "handler must not be null";
 assert type != null : "type must not be null";
 sinkBitlessEvent(type.getName());
 return ensureHandlers().addHandler(type, handler);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Adds a native event handler to the widget and sinks the corresponding
 * native event. If you do not want to sink the native event, use the generic
 * addHandler method instead.
 *
 * @param <H> the type of handler to add
 * @param type the event key
 * @param handler the handler
 * @return {@link HandlerRegistration} used to remove the handler
 */
public final <H extends EventHandler> HandlerRegistration addDomHandler(
  final H handler, DomEvent.Type<H> type) {
 assert handler != null : "handler must not be null";
 assert type != null : "type must not be null";
 int typeInt = Event.getTypeInt(type.getName());
 if (typeInt == -1) {
  sinkBitlessEvent(type.getName());
 } else {
  sinkEvents(typeInt);
 }
 return ensureHandlers().addHandler(type, handler);
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Adds this handler to the widget.
 *
 * @param <H> the type of handler to add
 * @param type the event type
 * @param handler the handler
 * @return {@link HandlerRegistration} used to remove the handler
 */
public final <H extends EventHandler> HandlerRegistration addHandler(
  final H handler, GwtEvent.Type<H> type) {
 return ensureHandlers().addHandler(type, handler);
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Adds this handler to the widget.
 *
 * @param <H> the type of handler to add
 * @param type the event type
 * @param handler the handler
 * @return {@link HandlerRegistration} used to remove the handler
 */
public final <H extends EventHandler> HandlerRegistration addHandler(
  final H handler, GwtEvent.Type<H> type) {
 return ensureHandlers().addHandler(type, handler);
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * For <a href=
 * "http://code.google.com/p/google-web-toolkit/wiki/UnderstandingMemoryLeaks"
 * >browsers which do not leak</a>, adds a native event handler to the widget.
 * Note that, unlike the
 * {@link #addDomHandler(EventHandler, com.google.gwt.event.dom.client.DomEvent.Type)}
 * implementation, there is no need to attach the widget to the DOM in order
 * to cause the event handlers to be attached.
 *
 * @param <H> the type of handler to add
 * @param type the event key
 * @param handler the handler
 * @return {@link HandlerRegistration} used to remove the handler
 */
public final <H extends EventHandler> HandlerRegistration addBitlessDomHandler(
  final H handler, DomEvent.Type<H> type) {
 assert handler != null : "handler must not be null";
 assert type != null : "type must not be null";
 sinkBitlessEvent(type.getName());
 return ensureHandlers().addHandler(type, handler);
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * For <a href=
 * "http://code.google.com/p/google-web-toolkit/wiki/UnderstandingMemoryLeaks"
 * >browsers which do not leak</a>, adds a native event handler to the widget.
 * Note that, unlike the
 * {@link #addDomHandler(EventHandler, com.google.gwt.event.dom.client.DomEvent.Type)}
 * implementation, there is no need to attach the widget to the DOM in order
 * to cause the event handlers to be attached.
 *
 * @param <H> the type of handler to add
 * @param type the event key
 * @param handler the handler
 * @return {@link HandlerRegistration} used to remove the handler
 */
public final <H extends EventHandler> HandlerRegistration addBitlessDomHandler(
  final H handler, DomEvent.Type<H> type) {
 assert handler != null : "handler must not be null";
 assert type != null : "type must not be null";
 sinkBitlessEvent(type.getName());
 return ensureHandlers().addHandler(type, handler);
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Adds a native event handler to the widget and sinks the corresponding
 * native event. If you do not want to sink the native event, use the generic
 * addHandler method instead.
 *
 * @param <H> the type of handler to add
 * @param type the event key
 * @param handler the handler
 * @return {@link HandlerRegistration} used to remove the handler
 */
public final <H extends EventHandler> HandlerRegistration addDomHandler(
  final H handler, DomEvent.Type<H> type) {
 assert handler != null : "handler must not be null";
 assert type != null : "type must not be null";
 int typeInt = Event.getTypeInt(type.getName());
 if (typeInt == -1) {
  sinkBitlessEvent(type.getName());
 } else {
  sinkEvents(typeInt);
 }
 return ensureHandlers().addHandler(type, handler);
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Adds a native event handler to the widget and sinks the corresponding
 * native event. If you do not want to sink the native event, use the generic
 * addHandler method instead.
 *
 * @param <H> the type of handler to add
 * @param type the event key
 * @param handler the handler
 * @return {@link HandlerRegistration} used to remove the handler
 */
public final <H extends EventHandler> HandlerRegistration addDomHandler(
  final H handler, DomEvent.Type<H> type) {
 assert handler != null : "handler must not be null";
 assert type != null : "type must not be null";
 int typeInt = Event.getTypeInt(type.getName());
 if (typeInt == -1) {
  sinkBitlessEvent(type.getName());
 } else {
  sinkEvents(typeInt);
 }
 return ensureHandlers().addHandler(type, handler);
}

相关文章