/** * Get the element data matching the key. */ public static <T> T data(Element e, String key) { return data(e, key, null); }
/** * Store arbitrary data associated with the specified element. * * We store this data in a global js object having the structure: * datacache [element.hashCode()] [key] = value * * @return the value stored in the element with the given name */ public static <T> T data(Element element, String key, T value) { return data(element, key, value, null); }
public void cancel(Element e) { Animation anim = (Animation) data(e, GQAnimation.ACTUAL_ANIMATION, null); if (anim != null) { anim.cancel(); } }
/** * Store arbitrary data associated with the matched elements in the named data store. */ public GQuery data(String name, Object value) { for (Element e : elements()) { data(e, name, value); } return this; }
/** * Return the value at the named data store for the first element in the set of matched * elements. */ @SuppressWarnings("unchecked") public <T> T data(String name) { return isEmpty() ? null : (T) data(get(0), name, null); }
/** * Restore a set of previously saved Css properties in every matched element. */ public void saveCssAttrs(String... cssProps) { for (Element e : elements) { for (String a : cssProps) { data(OLD_DATA_PREFIX + a, getStyleImpl().curCSS(e, a, false)); } } }
/** * Return the value at the named data store for the first element in the set of matched * elements, as set by data(name, value), with desired return type. * * @param clz return type class literal */ public <T> T data(String name, Class<? extends T> clz) { return isEmpty() ? null : data(get(0), name, null, clz); }
protected void onStart() { // Mark this animation as actual, so as we can stop it in the GQuery.stop() method $(e).data(ACTUAL_ANIMATION, this); super.onStart(); }
public Chosen update() { for (Element e : elements()) { ChosenImpl impl = $(e).data(CHOSEN_DATA_KEY, ChosenImpl.class); if (impl != null) { impl.update(); } } return this; }
public Chosen update() { for (Element e : elements()) { ChosenImpl impl = $(e).data(CHOSEN_DATA_KEY, ChosenImpl.class); if (impl != null) { impl.update(); } } return this; }
/** * Save a set of Css properties of every matched element. */ public void restoreCssAttrs(String... cssProps) { for (Element e : elements) { for (String a : cssProps) { String datakey = OLD_DATA_PREFIX + a; getStyleImpl().setStyleProperty(e, a, (String) data(e, datakey, null)); removeData(e, datakey); } } }
public Chosen update() { for (Element e : elements()) { ChosenImpl impl = $(e).data(CHOSEN_DATA_KEY, ChosenImpl.class); if (impl != null) { impl.update(); } } return this; }
public Chosen chosen(final ChosenOptions options, final EventBus eventBus) { for (Element e : elements()) { if ("select".equalsIgnoreCase(e.getTagName()) && !$(e).hasClass("chzn-done")) { ChosenImpl impl = GWT.create(ChosenImpl.class); impl.init(SelectElement.as(e), options, eventBus); $(e).data(CHOSEN_DATA_KEY, impl); } } return this; }
@Override public void onCancel() { Boolean jumpToEnd = Effects.$(e).data(Effects.JUMP_TO_END, Boolean.class); if (jumpToEnd != null && jumpToEnd) { onComplete(); } else { g.dequeue(); g.restoreCssAttrs(ATTRS_TO_SAVE); } }
public GQuery getChosenElement() { ChosenImpl impl = $(getElement()).data(CHOSEN_DATA_KEY, ChosenImpl.class); if (impl != null) { return impl.getContainer(); } return $(); }
protected GQuery getChosenElement() { ChosenImpl impl = $(getElement()).data(CHOSEN_DATA_KEY, ChosenImpl.class); if (impl != null) { return impl.getContainer(); } return $(); }
public Chosen destroy() { for (Element e : elements()) { ChosenImpl impl = $(e).data(CHOSEN_DATA_KEY, ChosenImpl.class); if (impl != null) { impl.release(); $(e).removeData(CHOSEN_DATA_KEY); } } return this; }
public Chosen destroy() { for (Element e : elements()) { ChosenImpl impl = $(e).data(CHOSEN_DATA_KEY, ChosenImpl.class); if (impl != null) { impl.release(); $(e).removeData(CHOSEN_DATA_KEY); } } return this; }
public Chosen chosen(final ChosenOptions options, final EventBus eventBus) { ChosenImplFactory factory = new ChosenImplFactory(); for (Element e : elements()) { if ("select".equalsIgnoreCase(e.getTagName()) && !$(e).hasClass("chzn-done")) { SelectElement selectElement = SelectElement.as(e); ChosenImpl impl = factory.createChosenImpl(selectElement, options); impl.init(selectElement, options, eventBus); $(e).data(CHOSEN_DATA_KEY, impl); } } return this; }
public Chosen chosen(final ChosenOptions options, final EventBus eventBus) { ChosenImplFactory factory = new ChosenImplFactory(); for (Element e : elements()) { if ("select".equalsIgnoreCase(e.getTagName()) && !$(e).hasClass("chzn-done")) { SelectElement selectElement = SelectElement.as(e); ChosenImpl impl = factory.createChosenImpl(selectElement, options); impl.init(selectElement, options, eventBus); $(e).data(CHOSEN_DATA_KEY, impl); } } return this; }