本文整理了Java中com.google.gwt.user.client.ui.Widget.addDomHandler()
方法的一些代码示例,展示了Widget.addDomHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.addDomHandler()
方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.Widget
类名称:Widget
方法名:addDomHandler
[英]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.
[中]向小部件添加本机事件处理程序,并接收相应的本机事件。如果不想接收本机事件,请改用泛型addHandler方法。
代码示例来源:origin: com.google.gwt/gwt-servlet
handlerRegs.add(widget.asWidget().addDomHandler(new TouchStartHandler() {
@Override
public void onTouchStart(TouchStartEvent event) {
handlerRegs.add(widget.asWidget().addDomHandler(new TouchMoveHandler() {
@Override
public void onTouchMove(TouchMoveEvent event) {
handlerRegs.add(widget.asWidget().addDomHandler(new TouchEndHandler() {
@Override
public void onTouchEnd(TouchEndEvent event) {
handlerRegs.add(widget.asWidget().addDomHandler(new TouchCancelHandler() {
@Override
public void onTouchCancel(TouchCancelEvent event) {
代码示例来源:origin: gwtbootstrap3/gwtbootstrap3
protected HandlerRegistration setupBlurValidation() {
return inputWidget.addDomHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent event) {
validate(validateOnBlur);
}
}, BlurEvent.getType());
}
代码示例来源:origin: org.gwtbootstrap3/gwtbootstrap3
protected HandlerRegistration setupBlurValidation() {
return inputWidget.addDomHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent event) {
validate(validateOnBlur);
}
}, BlurEvent.getType());
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
/** {@inheritDoc} */
@Override
public HandlerRegistration addTouchEndHandler(Widget w, TouchEndHandler handler) {
return w.addDomHandler(handler, TouchEndEvent.getType());
}
代码示例来源:origin: errai/errai
private void registerRecognizer(AbstractRecognizer recognizer) {
source.addDomHandler(recognizer, TouchStartEvent.getType());
source.addDomHandler(recognizer, TouchMoveEvent.getType());
source.addDomHandler(recognizer, TouchEndEvent.getType());
source.addDomHandler(recognizer, TouchCancelEvent.getType());
}
}
代码示例来源:origin: org.jboss.errai/errai-cordova
private void registerRecognizer(AbstractRecognizer recognizer) {
source.addDomHandler(recognizer, TouchStartEvent.getType());
source.addDomHandler(recognizer, TouchMoveEvent.getType());
source.addDomHandler(recognizer, TouchEndEvent.getType());
source.addDomHandler(recognizer, TouchCancelEvent.getType());
}
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
return field.addDomHandler(handler, BlurEvent.getType());
}
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
/** {@inheritDoc} */
@Override
public HandlerRegistration addTouchMoveHandler(Widget w, TouchMoveHandler handler) {
return w.addDomHandler(handler, TouchMoveEvent.getType());
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
/** {@inheritDoc} */
@Override
public HandlerRegistration addTouchStartHandler(Widget w, TouchStartHandler handler) {
return w.addDomHandler(handler, TouchStartEvent.getType());
}
代码示例来源:origin: com.googlecode.mgwt/mgwt
private void bindTransistionEndEvent(final boolean issueEvent) {
if (CssUtil.hasTransistionEndEvent()) {
transistionEndRegistration = scroller.addDomHandler(new TransitionEndHandler() {
@Override
public void onTransitionEnd(TransitionEndEvent event) {
onTransistionEnd(event, issueEvent);
}
}, TransitionEndEvent.getType());
}
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
/** {@inheritDoc} */
@Override
public HandlerRegistration addTouchStartHandler(Widget w, TouchStartHandler handler) {
return w.addDomHandler(new TouchStartToMouseDownHandler(handler), MouseDownEvent.getType());
}
代码示例来源:origin: oVirt/ovirt-engine
/**
* Adds a context menu handler to the given widget.
* @param widget The widget.
*/
public void addContextMenuHandler(Widget widget) {
widget.addDomHandler(event -> AbstractActionTable.this.onContextMenu(event), ContextMenuEvent.getType());
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
/** {@inheritDoc} */
@Override
public HandlerRegistration addTouchEndHandler(Widget w, TouchEndHandler handler) {
return w.addDomHandler(new TouchEndToMouseUpHandler(handler), MouseUpEvent.getType());
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
/** {@inheritDoc} */
@Override
public HandlerRegistration addTouchMoveHandler(Widget w, TouchMoveHandler handler) {
TouchMoveToMouseMoveHandler touchMoveToMouseMoveHandler = new TouchMoveToMouseMoveHandler(handler);
HandlerRegistrationCollection handlerRegistrationCollection = new HandlerRegistrationCollection();
handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseDownEvent.getType()));
handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseUpEvent.getType()));
handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseMoveEvent.getType()));
return handlerRegistrationCollection;
}
代码示例来源:origin: fr.putnami.pwt/pwt
public CollapseHelper(Widget toggleWidget, Element collapsableElement) {
this.collapsableElement = collapsableElement;
StyleUtils.addStyle(collapsableElement, CollapseHelper.STYLE_COLLAPSE);
toggleWidget.addDomHandler(this, ClickEvent.getType());
this.setInitialCollapse(this.collapsed);
}
代码示例来源:origin: fr.putnami.pwt/pwt
private CompositeFocusHelper(Widget containerWidget, HasFocusHandlers... hasFocusContents) {
this.containerWidget = containerWidget;
containerWidget.addDomHandler(this.keyDownHandler, KeyDownEvent.getType());
if (hasFocusContents != null) {
for (HasFocusHandlers hasFocus : hasFocusContents) {
this.addHasFocusContent(hasFocus);
}
}
this.handlerManager = new HandlerManager(containerWidget);
}
代码示例来源:origin: com.googlecode.mgwt/mgwt
@Override
public HandlerRegistration addTouchEndHandler(Widget w, TouchEndHandler handler) {
if (hasTouchSupport) {
return delegate.addTouchEndHandler(w, handler);
}
return w.addDomHandler(new TouchEndToMouseUpHandler(handler), MouseUpEvent.getType());
}
代码示例来源:origin: com.googlecode.mgwt/mgwt
@Override
public HandlerRegistration addTouchStartHandler(Widget w, TouchStartHandler handler) {
if (hasTouchSupport) {
return delegate.addTouchStartHandler(w, handler);
}
return w.addDomHandler(new TouchStartToMouseDownHandler(handler), MouseDownEvent.getType());
}
代码示例来源:origin: com.googlecode.mgwt/mgwt
@Override
public HandlerRegistration addTouchMoveHandler(Widget w, TouchMoveHandler handler) {
if (hasTouchSupport) {
return delegate.addTouchMoveHandler(w, handler);
}
TouchMoveToMouseMoveHandler touchMoveToMouseMoveHandler = new TouchMoveToMouseMoveHandler(handler);
HandlerRegistrationCollection handlerRegistrationCollection = new HandlerRegistrationCollection();
handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseDownEvent.getType()));
handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseUpEvent.getType()));
handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseMoveEvent.getType()));
return handlerRegistrationCollection;
}
代码示例来源:origin: oVirt/ovirt-engine
void addDoubleClickHandler(final W widget, final M modelProvider) {
if (modelProvider instanceof SearchableTableModelProvider<?, ?>) {
widget.addDomHandler(event -> {
SearchableListModel model = ((SearchableTableModelProvider<?, ?>) modelProvider).getModel();
UICommand command = model.getDoubleClickCommand();
if (command != null && command.getIsExecutionAllowed()) {
DeferredModelCommandInvoker invoker = new DeferredModelCommandInvoker(model);
invoker.invokeCommand(command);
}
}, DoubleClickEvent.getType());
}
}
内容来源于网络,如有侵权,请联系作者删除!