@Override public void add(Widget w) { Element elt = getElement(); add(w, elt); }
/** * Removes all Widgets from the content part of this {@link JQMCollapsible} instance. */ @Override public void clear() { super.clear(); }
/** * Assigns a default containerId of 'container' followed by the instance number. * @return the instance being operated on as part of a Fluent API */ public JQMContainer withContainerId() { setContainerId(generateContainerId()); return this; }
/** * Sets the containerId so it can be referenced by name. * @param containerId */ public void setContainerId(String containerId) { if (containerId == null) throw new IllegalArgumentException("id for JQMContainer cannot be null"); if (containerId.contains(" ")) throw new IllegalArgumentException("id for JQMContainer cannot contain space"); if (containerId.isEmpty()) { this.id = generateContainerId(); } else if (containerId.endsWith(AUTOINC_SUFFIX)) { this.id = containerId.substring(0, containerId.length() - AUTOINC_SUFFIX.length()) + (counter++); } else { this.id = containerId; } getElement().setId(this.id); setAttribute("data-url", this.id); }
/** * Removes the attribute with the given name * * @param name the name of the attribute to remove */ protected void removeAttribute(String name) { getElement().removeAttribute(name); }
public static void changePage(JQMContainer container, boolean dialog) { TransitionIntf<?> t = container.getTransition(); if (t == null) { t = dialog || JQMCommon.isDataDialog(container.getElement()) ? getDefaultDialogTransition() : getDefaultTransition(); } changePage(container, dialog, t); }
protected void setRole(String role) { String s = JQMCommon.getDataRole(this); if (s != null && !s.isEmpty()) removeStyleName("jqm4gwt-" + s); JQMCommon.setDataRole(this, role); addStyleName("jqm4gwt-" + role); }
/** * Convenience constructor that creates a button that shows the given JQMPage when clicked. * <br> * Note that the page param is an already instantiated page and thus will * be immediately inserted into the DOM. Do not use this constructor when * you want to lazily add the page. * * @param text the text to display on the button * @param c the {@link JQMContainer} to create a link to * @param t the transition type to use */ public JQMButton(String text, final JQMContainer c, final Transition t) { this(text, "#" + c.getId(), t); withRel(c.getRelType()); }
/** * Adds the given collection of widgets to the primary content panel of this container */ public void add(Collection<Widget> widgets) { for (Widget widget : widgets) add(widget); }
@Override public String getTheme() { String rslt = JQMCommon.getThemeEx(this, "ui-page-theme-"); if (rslt == null || rslt.isEmpty()) rslt = super.getTheme(); return rslt; }
public String getDataUrl() { return getAttribute("data-url"); }
public static void changePage(JQMContainer container, boolean dialog, TransitionIntf<?> transition, boolean reverse) { Mobile.changePage("#" + container.getId(), transition, reverse, defaultChangeHash, dialog); }
/** * Sets the containerId so it can be referenced by name. * @param containerId */ public void setContainerId(String containerId) { if (containerId == null) throw new IllegalArgumentException("id for JQMContainer cannot be null"); if (containerId.contains(" ")) throw new IllegalArgumentException("id for JQMContainer cannot contain space"); if (containerId.isEmpty()) { this.id = generateContainerId(); } else if (containerId.endsWith(AUTOINC_SUFFIX)) { this.id = containerId.substring(0, containerId.length() - AUTOINC_SUFFIX.length()) + (counter++); } else { this.id = containerId; } getElement().setId(this.id); setAttribute("data-url", this.id); }
/** * Sets the value of the attribute with the given name to the given value. */ protected void setAttribute(String name, String value) { getElement().setAttribute(name, value); }
public static void changePage(JQMContainer container, boolean dialog) { TransitionIntf<?> t = container.getTransition(); if (t == null) { t = dialog || JQMCommon.isDataDialog(container.getElement()) ? getDefaultDialogTransition() : getDefaultTransition(); } changePage(container, dialog, t); }
protected void setRole(String role) { String s = JQMCommon.getDataRole(this); if (s != null && !s.isEmpty()) removeStyleName("jqm4gwt-" + s); JQMCommon.setDataRole(this, role); addStyleName("jqm4gwt-" + role); }
/** * Convenience constructor that creates a button that shows the given JQMPage when clicked. * <br> * Note that the page param is an already instantiated page and thus will * be immediately inserted into the DOM. Do not use this constructor when * you want to lazily add the page. * * @param text the text to display on the button * @param c the {@link JQMContainer} to create a link to * @param t the transition type to use */ public JQMButton(String text, final JQMContainer c, final Transition t) { this(text, "#" + c.getId(), t); withRel(c.getRelType()); }
/** * Adds the given collection of widgets to the primary content panel of this container */ public void add(Collection<Widget> widgets) { for (Widget widget : widgets) add(widget); }
@Override public String getTheme() { String rslt = JQMCommon.getThemeEx(this, "ui-page-theme-"); if (rslt == null || rslt.isEmpty()) rslt = super.getTheme(); return rslt; }
public String getDataUrl() { return getAttribute("data-url"); }