Package com.google.gwt.query.client

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


    // select other draggable elements if select options is set
    SelectFunction selectFunction = options.getSelect();
    if (selectFunction != null) {
      GQuery followers = selectFunction.selectElements();
      followers.each(new Function() {
        @Override
        public void f(Element e) {
          DraggableHandler handler = DraggableHandler.getInstance(e);
          if (handler != null) {
            GWT.log("Select automatic selected element " + e.getId());
View Full Code Here


      return false;
    }

    RevertOption revertOption = options.getRevert();
    if (revertOption.doRevert(dropped)) {
      handler.revertToOriginalPosition(new Function() {
        @Override
        public void f(Element e) {
          callPlugins(new StopCaller(ctx, handler, event), options);
          triggerDragStop(ctx, options);
View Full Code Here

  public HomeViewImpl() {
    initWidget(viewUiBinder.createAndBindUi(this));

    Element el = getElement();
    $(el).find("[place]").click(new Function() {
      @Override
      public boolean f(Event e) {
        String place = $(e).attr("place");
        HomePlace homePlace = activity.getPlace();
        activity.goTo(homePlace.getChild(place));
View Full Code Here

  }

  public void setupDemoElement(Element demo) {
    $("#dialog").as(Ui).dialog("{autoOpen: false, show: 'blind', hide: 'explode'}");

    $("#opener").click(new Function() {
      @Override
      public boolean f(Event e) {
        $("#dialog").as(Ui).dialog().open();
        return false;
      }
View Full Code Here

    return "Range slider";
  }

  public void setupDemoElement(Element demo) {

    $("#slider-range").as(Ui).slider(Slider.Options.create().range(true).min(0).max(500).values(75, 300)).bind(Slider.Event.slide, new Function() {
      @Override
      public boolean f(Event e, Object data) {
        Slider.Event slideEvent = ((JavaScriptObject) data).cast();
        $("#amount").val("$" + slideEvent.intValues().get(0) + " - $" + slideEvent.intValues().get(1));
        return false;
View Full Code Here

  public String getName() {
    return "Snap to increments";
  }

  public void setupDemoElement(Element demo) {
    $("#slider").as(Ui).slider("{value:100, min: 0, max: 500, step: 50}").bind(Slider.Event.slide, new Function() {
      @Override
      public boolean f(Event e, Object data) {
        Slider.Event slideEvent = ((JavaScriptObject) data).cast();
        $("#amount").val("$" + slideEvent.intValue());
        return false;
View Full Code Here

    return "Format date";
  }

  public void setupDemoElement(Element demo) {
    $("#datepicker", demo).as(Ui).datepicker();
    $("#format").change(new Function() {
      @Override
      public boolean f(Event e) {
        $("#datepicker").as(Ui).datepicker().option(Datepicker.Options.create().dateFormat($(e).val()));
        return false;
      }
View Full Code Here

  public void setupDemoElement(Element demo) {
    $("#dialog-message", demo).as(Ui).dialog(//
    Dialog.Options.create().modal(true)//
    .buttons(Buttons.create()//
    .define("Ok", new Function() {
      @Override
      public boolean f(Event e) {
        // we can't use $(this)
        $("#dialog-message").as(Ui).dialog().close();
        return false;
View Full Code Here

  }

  public void setupDemoElement(final Element demo) {
    $("#accordion", demo).as(Ui).accordion(Accordion.Options.create().fillSpace(true));

    $("#accordionResizer", demo).as(Ui).resizable().bind("resize", new Function() {
      @Override
      public boolean f(Event e) {
        $("#accordion", demo).as(Ui).accordion().resize();
        return true;
      }
View Full Code Here

  public String getName() {
    return "Default Functionality";
  }

  public void setupDemoElement(Element demo) {
    Function position = new Function() {
      @Override
      public void f(Element e) {
        $(".positionable").as(Ui).position(Position.Options.create() //
        .of($("#parent"))//
        .my($("#my_horizontal").val() + ' ' + $("#my_vertical").val())//
        .at($("#at_horizontal").val() + ' ' + $("#at_vertical").val())//
        .offset($("#offset").val()) //
        .collision($("#collision_horizontal").val() + ' ' + $("#collision_vertical").val()));
      }
    };

    $(".positionable").css("opacity", "0.5");

    // TODO: investigate why ":input" is throwing an exception.
    $("input").bind(Event.ONCLICK | Event.ONKEYUP | Event.ONCHANGE, null, position);
    $("select").bind(Event.ONCHANGE, null, position);

    $("#parent").as(Ui).draggable().bind("drag", position);

    $(".positionable").as(Ui).draggable().bind("drag", new Function() {
      @Override
      public boolean f(Event e, Object data) {
        // reset offset before calculating it
        $("#offset").val("0");
        // TODO: implement using GQuery
        // position(function(result) {
        // $("#offset").val("" + (ui.offset.left - result.left) + " " + (ui.offset.top - result.top));
        // position();
        // });

        return false;
      }
    });

    position.f(demo);

  }
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.