View Javadoc
1   /*
2    * Copyright 2011 Daniel Kurka
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * the License at
7    * 
8    * http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package com.googlecode.mgwt.ui.client.widget.touch;
17  
18  import com.google.gwt.event.shared.HandlerRegistration;
19  import com.google.gwt.user.client.ui.Widget;
20  import com.googlecode.mgwt.dom.client.event.touch.TouchCancelEvent;
21  import com.googlecode.mgwt.dom.client.event.touch.TouchCancelHandler;
22  import com.googlecode.mgwt.dom.client.event.touch.TouchEndEvent;
23  import com.googlecode.mgwt.dom.client.event.touch.TouchEndHandler;
24  import com.googlecode.mgwt.dom.client.event.touch.TouchMoveEvent;
25  import com.googlecode.mgwt.dom.client.event.touch.TouchMoveHandler;
26  import com.googlecode.mgwt.dom.client.event.touch.TouchStartEvent;
27  import com.googlecode.mgwt.dom.client.event.touch.TouchStartHandler;
28  
29  /**
30   * The implementation for touch devices of {@link TouchWidgetImpl}
31   *
32   * @author Daniel Kurka
33   * @version $Id: $
34   */
35  public class TouchWidgetMobileImpl implements TouchWidgetImpl {
36  
37  	/*
38  	 * (non-Javadoc)
39  	 * @see com.googlecode.mgwt.ui.client.widget.touch.TouchWidgetImpl#addTouchStartHandler(com.google.gwt.user.client.ui.Widget, com.googlecode.mgwt.dom.client.event.touch.TouchStartHandler)
40  	 */
41  	/** {@inheritDoc} */
42  	@Override
43  	public HandlerRegistration addTouchStartHandler(Widget w, TouchStartHandler handler) {
44  		return w.addDomHandler(handler, TouchStartEvent.getType());
45  	}
46  
47  	/*
48  	 * (non-Javadoc)
49  	 * @see com.googlecode.mgwt.ui.client.widget.touch.TouchWidgetImpl#addTouchMoveHandler(com.google.gwt.user.client.ui.Widget, com.googlecode.mgwt.dom.client.event.touch.TouchMoveHandler)
50  	 */
51  	/** {@inheritDoc} */
52  	@Override
53  	public HandlerRegistration addTouchMoveHandler(Widget w, TouchMoveHandler handler) {
54  		return w.addDomHandler(handler, TouchMoveEvent.getType());
55  	}
56  
57  	/*
58  	 * (non-Javadoc)
59  	 * @see com.googlecode.mgwt.ui.client.widget.touch.TouchWidgetImpl#addTouchCancelHandler(com.google.gwt.user.client.ui.Widget, com.googlecode.mgwt.dom.client.event.touch.TouchCancelHandler)
60  	 */
61  	/** {@inheritDoc} */
62  	@Override
63  	public HandlerRegistration addTouchCancelHandler(Widget w, TouchCancelHandler handler) {
64  		return w.addDomHandler(handler, TouchCancelEvent.getType());
65  	}
66  
67  	/*
68  	 * (non-Javadoc)
69  	 * @see com.googlecode.mgwt.ui.client.widget.touch.TouchWidgetImpl#addTouchEndHandler(com.google.gwt.user.client.ui.Widget, com.googlecode.mgwt.dom.client.event.touch.TouchEndHandler)
70  	 */
71  	/** {@inheritDoc} */
72  	@Override
73  	public HandlerRegistration addTouchEndHandler(Widget w, TouchEndHandler handler) {
74  		return w.addDomHandler(handler, TouchEndEvent.getType());
75  	}
76  
77  }