]> source.dussan.org Git - gwtquery.git/commitdiff
updated LazyEvents with new methods
authorManolo Carrasco <manolo@apache.org>
Sat, 31 Jul 2010 11:28:56 +0000 (11:28 +0000)
committerManolo Carrasco <manolo@apache.org>
Sat, 31 Jul 2010 11:28:56 +0000 (11:28 +0000)
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEvents.java

index 71e79501cf8d1c7e57d16839c54d655659d7398a..6a320ba33ea5e87e7325826c6d2c822011da2cb5 100644 (file)
@@ -39,6 +39,36 @@ public interface LazyEvents<T> extends LazyBase<T>{
    */
   LazyEvents<T> bind(int eventbits, Object data, Function...funcs);
 
+  /**
+   * Binds a set of handlers to a particular Event for each matched element.
+   * 
+   * The namespace is a way to group events of the same type, making easier unbind
+   * specific handlers.
+   * 
+   * The event handlers are passed as Functions that you can use to prevent
+   * default behavior. To stop both default action and event bubbling, the
+   * function event handler has to return false.
+   * 
+   * You can pass an additional Object data to your Function
+   * 
+   */  
+  LazyEvents<T> bind(int eventbits, String namespace, Object data, Function...funcs);
+
+  /**
+   * Binds a set of handlers to a particular Event for each matched element.
+   * 
+   * The name could contain a namespace which is a way to group events of the same type, 
+   * making easier unbind specific handlers.
+   * 
+   * The event handlers are passed as Functions that you can use to prevent
+   * default behavior. To stop both default action and event bubbling, the
+   * function event handler has to return false.
+   * 
+   * You can pass an additional Object data to your Function
+   * 
+   */  
+  LazyEvents<T> bind(String event, Object data, Function...funcs);
+
   /**
    * Binds a handler to a particular Event (like Event.ONCLICK) for each matched
    * element. The handler is executed only once for each element.
@@ -81,4 +111,20 @@ public interface LazyEvents<T> extends LazyBase<T>{
    */
   LazyEvents<T> unbind(int eventbits);
 
+  /**
+   * Removes all handlers, that matches the events bits and the namespace
+   * passed, from each element.
+   * 
+   * Example: unbind(Event.ONCLICK | Event.ONMOUSEOVER, "my.namespace")
+   */
+  LazyEvents<T> unbind(int eventbits, String name);
+
+  /**
+   * Removes all handlers, that matches event name passed. This name
+   * could contain a namespace.
+   * 
+   * Example: unbind("click.my.namespace")
+   */
+  LazyEvents<T> unbind(String name);
+
 }