@Inject public TouchReservationHandler(@Assisted IsWidget widget, final EventsBus eventsBus) { handlerRegistration = widget.asWidget().addDomHandler(new TouchStartHandler() { @Override public void onTouchStart(TouchStartEvent event) { eventsBus.fireEvent(new PlayerEvent(PlayerEventTypes.TOUCH_EVENT_RESERVATION)); } }, TouchStartEvent.getType()); }
/** * Create a new PlotView. This constructor is typically used when the * PlotView <em>will</em> be placed insides a scrolled window. */ public WebPlotView() { initWidgets(); _scrollingRootPanel.addDomHandler(new MouseDownHandler() { public void onMouseDown(MouseDownEvent ev) { if (_mpw != null) _mpw.selectSelf(); } }, MouseDownEvent.getType()); _scrollingRootPanel.addDomHandler(new TouchStartHandler() { public void onTouchStart(TouchStartEvent event) { if (_mpw != null) _mpw.selectSelf(); } }, TouchStartEvent.getType()); }
@Inject public VideoFullScreenViewImpl(EventsBus eventsBus) { this.eventsBus = eventsBus; initWidget(uiBinder.createAndBindUi(this)); container.addDomHandler(new TouchStartHandler() { @Override public void onTouchStart(TouchStartEvent event) { VideoFullScreenViewImpl.this.eventsBus.fireEvent(new PlayerEvent(PlayerEventTypes.TOUCH_EVENT_RESERVATION)); } }, TouchStartEvent.getType()); }
@Before public void before() { isWidget = mock(IsWidget.class); Widget widget = mock(Widget.class); doReturn(handlerRegistration).when(widget) .addDomHandler(Matchers.any(TouchStartHandler.class), Matchers.any(Type.class)); doReturn(widget).when(isWidget) .asWidget(); eventsBus = mock(EventsBus.class); }
@Test public void TouchReservationHandler() throws Exception { TouchReservationHandler instance = new TouchReservationHandler(isWidget, eventsBus); verify(isWidget.asWidget()).addDomHandler(Matchers.any(TouchStartHandler.class), typeCaptor.capture()); assertTrue(typeCaptor.getValue() .equals(TouchStartEvent.getType())); }
@Test public void initializeCanvasTest() { Canvas canvas = mock(Canvas.class); testObj.initializeCanvas(canvas); verify(canvas).addTouchStartHandler(Matchers.any(TouchStartHandler.class)); verify(moduleView).add(canvas); verify(preloader).hidePreloaderAndRemoveFromParent(); }
public HandlerRegistration addTouchStartHandler(TouchStartHandler handler) { return addDomHandler(handler, TouchStartEvent.getType()); }
@Override public com.google.gwt.event.shared.HandlerRegistration addTouchStartHandler(TouchStartHandler handler) { return this.addDomHandler(handler, TouchStartEvent.getType()); }
@Override public HandlerRegistration addTouchStartHandler(TouchStartHandler handler) { return this.addDomHandler(handler, TouchStartEvent.getType()); }
@Override public HandlerRegistration addTouchStartHandler(TouchStartHandler handler) { return addDomHandler(handler, TouchStartEvent.getType()); }
@Override public HandlerRegistration addTouchStartHandler(TouchStartHandler handler) { return viewport.addTouchStartHandler(handler); }