Example usage for com.google.gwt.query.client.plugins Events Events

List of usage examples for com.google.gwt.query.client.plugins Events Events

Introduction

In this page you can find the example usage for com.google.gwt.query.client.plugins Events Events.

Prototype

Events

Source Link

Usage

From source file:gwtquery.plugins.commonui.client.MouseHandler.java

License:Apache License

protected void destroyMouseHandler() {
    as(Events.Events).unbind(Event.ONMOUSEDOWN | Event.ONCLICK, getPluginName());
}

From source file:gwtquery.plugins.commonui.client.MouseHandler.java

License:Apache License

/**
 * This method initialize all needed handlers
 * //  w  w w.  j  a  v a2  s .  c  o m
 * @param options
 */
protected void initMouseHandler(MouseOptions options) {
    this.options = options;

    for (final Element e : elements()) {

        $(e).as(Events.Events).bind(Event.ONMOUSEDOWN, getPluginName(), (Object) null, new Function() {
            @Override
            public boolean f(com.google.gwt.user.client.Event event) {
                return mouseDown(e, Event.create(event));

            }
        }).bind(Event.ONCLICK, getPluginName(), (Object) null, new Function() {
            @Override
            public boolean f(com.google.gwt.user.client.Event event) {
                preventClickEvent |= !mouseClick(e, Event.create(event));

                if (preventClickEvent) {

                    preventClickEvent = false;
                    event.stopPropagation();
                    event.preventDefault();
                    return false;
                }

                return true;
            }
        });
    }

}

From source file:gwtquery.plugins.commonui.client.MouseHandler.java

License:Apache License

private void bindOtherMouseEvent(final Element element) {

    $(document).as(Events.Events).bind(Event.ONMOUSEMOVE, getPluginName(), (Object) null, new Function() {
        @Override/*  w w w  .j  a v a2  s  .c  om*/
        public boolean f(com.google.gwt.user.client.Event e) {
            mouseMove(element, Event.create(e));
            return false;
        }
    }).bind(Event.ONMOUSEUP, getPluginName(), (Object) null, new Function() {
        @Override
        public boolean f(com.google.gwt.user.client.Event e) {
            mouseUp(element, Event.create(e));
            return false;
        }
    });
}

From source file:gwtquery.plugins.commonui.client.MouseHandler.java

License:Apache License

private void unbindOtherMouseEvent() {
    $(document).as(Events.Events).unbind((Event.ONMOUSEUP | Event.ONMOUSEMOVE), getPluginName());
}