Package com.google.gwt.query.client.js

Examples of com.google.gwt.query.client.js.JsNodeArray.addNode()


    if (snapWidgets == null) {
      return;
    }
    JsNodeArray snapElements = JsNodeArray.create();
    for (Widget w : snapWidgets) {
      snapElements.addNode(w.getElement());
    }
    options.setSnap($(snapElements));
  }

  /**
 
View Full Code Here


    if (stackWidgets == null) {
      return;
    }
    JsNodeArray stackElements = JsNodeArray.create();
    for (Widget w : stackWidgets) {
      stackElements.addNode(w.getElement());
    }
    options.setStack($(stackElements));
  }

  /**
 
View Full Code Here

    SelectorEngineImpl selSizz = new SelectorEngineSizzle();
    GQuery g = $(e).html("<div><p></p><p></p><span></span><p></p>");
    JsNodeArray a;
    a = selSizz.select("p", e).cast();
    assertEquals(3, a.getLength());
    a.addNode(a.getNode(0));
    a.addNode(a.getNode(3));
    assertEquals(5, a.getLength());
    a = g.unique(a);
    assertEquals(3, a.getLength());
  }
View Full Code Here

    GQuery g = $(e).html("<div><p></p><p></p><span></span><p></p>");
    JsNodeArray a;
    a = selSizz.select("p", e).cast();
    assertEquals(3, a.getLength());
    a.addNode(a.getNode(0));
    a.addNode(a.getNode(3));
    assertEquals(5, a.getLength());
    a = g.unique(a);
    assertEquals(3, a.getLength());
  }
View Full Code Here

    assertEquals(3, $html.filter("div").length());
    assertEquals(1, $html.filter("span").length());

    JsNodeArray array = JsNodeArray.create();
    for (int i = 0 ; i < 3; i++){
          array.addNode(DOM.createDiv());
     }
     assertEquals(3, $(array).filter("div").length());


     String content2 = "<div><div class='inner first'>Hello</div><div class='inner second'>And</div><div class='inner third'>Goodbye</div></div>";
View Full Code Here

      JsArrayMixed c = jso.cast();
      JsNodeArray elms = JsNodeArray.create();
      for (int i = 0; i < c.length(); i++) {
        Object obj = c.getObject(i);
        if (obj instanceof Node) {
          elms.addNode((Node) obj);
        }
      }
      return $(elms);
    }
View Full Code Here

  public static GQuery $(List<?> nodesOrWidgets) {
    JsNodeArray elms = JsNodeArray.create();
    if (nodesOrWidgets != null) {
      for (Object o : nodesOrWidgets) {
        if (o instanceof Node) {
          elms.addNode((Node) o);
        } else if (o instanceof IsWidget) {
          elms.addNode(((IsWidget)o).asWidget().getElement());
        }
      }
    }
View Full Code Here

    if (nodesOrWidgets != null) {
      for (Object o : nodesOrWidgets) {
        if (o instanceof Node) {
          elms.addNode((Node) o);
        } else if (o instanceof IsWidget) {
          elms.addNode(((IsWidget)o).asWidget().getElement());
        }
      }
    }
    return new GQuery(elms);
  }
View Full Code Here

   * elements to another location in the DOM.
   */
  public GQuery clone() {
    JsNodeArray result = JsNodeArray.create();
    for (Element e : elements) {
      result.addNode(e.cloneNode(true));
    }
    GQuery ret = new GQuery(result);
    ret.currentContext = currentContext;
    ret.currentSelector = currentSelector;
    return ret;
View Full Code Here

    for (Element e : elements) {
      Element current = e;
      while (current != null && current.getOwnerDocument() != null && current != context) {
        boolean match = pos != null ? pos.index(current) > -1 : $(current).is(selector);
        if (match) {
          result.addNode(current);
          break;
        } else {
          current = current.getParentElement();
        }
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.