/** * Override this for methods which invoke a cancel action. * * @param e takes a com.google.gwt.dom.client.Element. * */ public void cancel(com.google.gwt.dom.client.Element e) { setElement(e); // This has to be the order of calls cancel(e.<com.google.gwt.user.client.Element> cast()); }
/** * Utility method to get a string representation with the content * of the arguments array. It recursively visits arrays and inspect * object to print an appropriate representation of them. * * It is very useful to debug arguments passed in nested promises. * * It is protected so as it can be used in Inner functions. * * Output example: * <pre> * [0](com.google.gwt.query.client.plugins.QueuePlugin) <div>a1</div><div>a2</div> * [1](com.google.gwt.query.client.plugins.QueuePlugin) <div>a1</div><div>a2</div> * [2](java.lang.String) Foo * [3](JSO) {"bar":"foo"} * </pre> */ protected String dumpArguments() { return dumpArguments(arguments, "\n"); }
/** * Override this method for bound callbacks. */ public void f(int i, Object... args) { setIndex(i); setArguments(args); if (args.length == 1 && args[0] instanceof JavaScriptObject) { if (JsUtils.isElement((JavaScriptObject) args[0])) { setElement((com.google.gwt.dom.client.Element) args[0]); f(getElement(), i); } else if (JsUtils.isEvent((JavaScriptObject) args[0])) { setEvent((Event) args[0]); f(getEvent()); } else { f(); } } }
/** * Override this method for bound callbacks. */ public Object f(Object... args) { setArguments(args); f(); return true; }
/** * Override this method for bound event handlers if you wish to deal with * per-handler user data. * * @return boolean false means stop propagation and prevent default */ public boolean f(Event e, Object... arg) { setArguments(arg); setEvent(e); return f(e); }
/** * Override this for GQuery methods which loop over matched elements and * invoke a callback on each element. * * @param e takes a com.google.gwt.dom.client.Element. * */ public Object f(com.google.gwt.dom.client.Element e, int i) { setElement(e); setIndex(i); // This has to be the order of calls return f(e.<com.google.gwt.user.client.Element> cast(), i); }
public boolean f(Event e) { int n = fn.length == 1 ? 0 : (click++ % fn.length); return fn[n].f(e); } });
@Deprecated public void f(com.google.gwt.user.client.Element e) { setElement(e); Widget w = e != null ? GQuery.getAssociatedWidget(e) : null; if (w != null) { loop = true; f(w); } else { f(); } }
if (filter != null) { Object newArgs = filter.setArguments(oldArgs).f(oldArgs); p.progress(new Function() { public void f() { settle(PROGRESS, getArguments()); p.always(new Function() { public void f() { settle((type == DONE || type == FAIL && cont) && p.isResolved() ? DONE : FAIL,
/** * 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); }
/** * Methods fe(...) should be used from asynchronous contexts so as we can * catch the exception and send it to the GWT UncaughtExceptionHandler. * They are intentionally final to avoid override them */ public final void fe() { fe(arguments); }
/** * Utility method for safety getting a JavaScriptObject present at a certain * position in the list of arguments. */ public <T extends JavaScriptObject> T getArgumentJSO(int idx) { return getArgumentJSO(-1, idx); }
/** * @deprecated use: getArgument() instead. */ @Deprecated public Properties getDataProperties() { return getDataProperties(0); }
/** * @deprecated use getArguments instead. */ @Deprecated public Object[] getData() { return getArguments(); }
/** * Utility method for safety getting an object present at a certain * position in the list of arguments composed by arrays. * * Useful for Deferred chains where result of each resolved * promise is set as an array in the arguments list. * * When the object found in the array doesn't match the type required it returns a null. * * Note: If type is null, we don't check the class of the object found andd you could * eventually get a casting exception. * */ @SuppressWarnings("unchecked") public <T> T getArgument(int argIdx, int pos, Class<? extends T> type) { Object[] objs = getArgumentArray(argIdx); Object o = objs.length > pos ? objs[pos] : null; if (o != null && ( // When type is null we don't safety check type == null || // The object is an instance of the type requested o.getClass() == type || // Overlay types type == JavaScriptObject.class && o instanceof JavaScriptObject )) { return (T) o; } return null; }
private void stop(Element elem, String name, boolean clear, boolean jumpToEnd) { @SuppressWarnings("rawtypes") Queue q = queue(elem, name, null); if (q != null) { Object f = q.peek(); if (clear) { q.clear(); } if (f != null) { if (f instanceof Function) { // pass jumpToEnd to Animation.onCancel() via the element's data object $(elem).data(JUMP_TO_END, Boolean.valueOf(jumpToEnd)); ((Function) f).cancel(elem); $(elem).removeData(JUMP_TO_END); } dequeueIfNotDoneYet(elem, name, f); } } } }
/** * Override this for GQuery methods which loop over matched widgets and * invoke a callback on each widget. * * NOTE: If your query has non-widget elements you might need to override * 'public void f()' or 'public void f(Element e)' to handle these elements and * avoid a runtime exception. */ public Object f(Widget w, int i) { setElement(w.getElement()); setIndex(i); f(w); return null; }
/** * Execute a function around each object. */ public static <T> void each(T[] objects, Function f) { for (int i = 0, l = objects.length; i < l; i++) { f.f(i, objects[i]); } }
/** * Override this for GQuery methods which take a callback and do not expect a * return value. * * @param e takes a com.google.gwt.dom.client.Element */ public void f(com.google.gwt.dom.client.Element e) { setElement(e); // This has to be the order of calls f(e.<com.google.gwt.user.client.Element> cast()); }