/** * Wrap a GQuery around the element of a Function callback. */ public static GQuery $(Function f) { return $(f.getElement()); }
/** * Wrap the inner child contents of each matched element (including text nodes) with an HTML * structure. This wrapping process is most useful for injecting additional structure into a * document, without ruining the original semantic qualities of a document. This works by going * through the first element provided (which is generated, on the fly, from the provided HTML) and * finds the deepest ancestor element within its structure -- it is that element that will enwrap * everything else. */ public GQuery wrapInner(Element elem) { return wrapInner($(elem)); }
public static IsProperties create() { return getFactory().create(); }
/** * Return a style property on the first matched element. */ public String css(String name) { return css(name, true); }
/** * Reduce the set of matched elements to the first in the set. */ public GQuery first() { return eq(0); }
/** * Insert all of the matched elements before another, specified, set of elements. * * The elements must already be inserted into the document (you can't insert an element after * another if it's not in the page). */ public GQuery insertBefore(GQuery query) { for (Element e : elements) { query.before(e); } return this; }
@SuppressWarnings("unchecked") public <T extends IsProperties> T set(Object key, Object val) { if (val instanceof IsProperties) { p.set(key, ((IsProperties) val).getDataImpl()); } else { p.set(key, val); } return (T) this; }
/** * Convenience alias for the getArguments(idx) method thought just to * make gQuery code look closed to jQuery. */ public <T> T arguments(int idx) { return getArgument(idx); }
/** * Insert content before each of the matched elements. The elements must already be inserted into * the document (you can't insert an element before another if it's not in the page). */ public GQuery before(String html) { return domManip(html, DomMan.BEFORE); }
/** * Revert the most recent 'destructive' operation, changing the set of matched elements to its * previous state (right before the destructive operation). */ public GQuery end() { return previousObject != null ? previousObject : new GQuery(); }
public boolean f(Event e) { int n = fn.length == 1 ? 0 : (click++ % fn.length); return fn[n].f(e); } });
/** * Safety return the argument in the position idx. * * If the element class is not of the requested type it returns null and * you don't get casting exeption. */ public <T> T getArgument(int argIdx, int pos) { return getArgument(argIdx, pos, null); }