Package com.google.gwt.query.client

Examples of com.google.gwt.query.client.Function


  public void setupDemoElement(Element demo) {
    $("#draggable").as(Ui).draggable("{revert: 'valid'}");
    $("#draggable2").as(Ui).draggable("{revert: 'invalid'}");

    $("#droppable").as(Ui).droppable(Droppable.Options.create().activeClass("ui-state-hover").hoverClass("ui-state-active"))//
    .bind(Droppable.Event.drop, new Function() {
      @Override
      public void f(Element e) {
        $(e).addClass("ui-state-highlight").find("p").html("Dropped!");
      }
    });
View Full Code Here


    // TODO: figure out why this is not behaving like it should. Seems like all #droppables
    // are receiving the drop event regardless of where the draggable is dropped

    $("#droppable, #droppable-inner").as(Ui).droppable("{activeClass:'ui-state-hover', hoverClass:'ui-state-active'}")//
    .bind(Droppable.Event.drop, new Function() {
      @Override
      public boolean f(Event e) {
        $(e).addClass("ui-state-highlight").children("p").html("Dropped!");
        return false;
      }
    });

    $("#droppable2, #droppable2-inner").as(Ui).droppable("{greedy:true, activeClass:'ui-state-hover', hoverClass:'ui-state-active'}")//
    .bind(Droppable.Event.drop, new Function() {
      @Override
      public void f(Element e) {
        $(e).addClass("ui-state-highlight").children("p").html("Dropped!");
      }
    });
View Full Code Here

  }

  public void setupDemoElement(Element demo) {
    $("button, a, input", demo).as(Ui).button();

    $("a", demo).click(new Function() {
      @Override
      public boolean f(Event e) {
        return false;
      }
    });
View Full Code Here

        final GQuery tooltip = getTip();

        tooltip.removeClass(style.in());

        if (options.isAnimation()) {
            tooltip.fadeOut(ANIMATION_DURATION, new Function() {
                @Override
                public void f() {
                    tooltip.detach();
                }
            });
View Full Code Here

        } else {
            fixTitle();
        }

        if (options.getTrigger() == TooltipTrigger.CLICK) {
            bind("click", new Function() {
                @Override
                public boolean f(Event e) {
                    toggle(e, delegationOptions);
                    return true;
                }
            });
        } else if (options.getTrigger() != TooltipTrigger.MANUAL) {
            String eventIn = options.getTrigger() == TooltipTrigger.HOVER ? "mouseenter" : "focus";
            String eventOut = options.getTrigger() == TooltipTrigger.HOVER ? "mouseleave" : "blur";
            bind(eventIn, new Function() {
                @Override
                public boolean f(Event e) {
                    enter(e, delegationOptions);
                    return true;
                }
            });
            bind(eventOut, new Function() {
                @Override
                public boolean f(Event e) {
                    leave(e, delegationOptions);
                    return true;
                }
View Full Code Here

    if (settings.getTimeout() < 1) {
      settings.setTimeout(10000);
    }
   
    return getXhr(settings, false)
      .then(new Function() {
        public Object f(Object... args) {
          Response response = arguments(0);
          if (response.getText().matches(jsonpCbRexp)) {
            return GQ.create(response.getText().replaceFirst(jsonpCbRexp, "$1"));
          } else {
View Full Code Here

      // Some browsers need after setting initial properties re-flow (FF 24.4.0).
      .offset();

    // Compute final properties
    p = getFxProperties(false);
    g.transition(p, duration, easing, delay, new Function(){public void f() {
      onComplete();
    }});
  }
View Full Code Here

    assertEquals(1234l, c.getD());
    c.y("y");
    assertEquals("y", c.y());
    assertEquals(1, c.getItems().size());

    c.setF(new Function() {
      public void f() {
        functionRun = true;
      }
    });
    assertFalse(functionRun);
View Full Code Here

      return "bind function for event type " + (eventName != null ? eventName : "" + type);
    }

    public boolean isEquals(Function f) {
      assert f != null : "function f cannot be null";
      Function functionToCompare =
          function instanceof HandlerWrapper ? ((HandlerWrapper) function).getOriginalHandler()
              : function;
      return f.equals(functionToCompare);
    }
View Full Code Here

    if (isSpecialEvent) {
      GqEvent.setOriginalEventType(e, originalEventName);
    }

    if ("submit".equals(htmlEvent)){
      Function submitFunction = new Function() {
        public void f(Element e) {
          // first submit the form then call the others functions
          if (FormElement.is(e)) {
            e.<FormElement>cast().submit();
          }
View Full Code Here

TOP

Related Classes of com.google.gwt.query.client.Function

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.