/** * Sets the identifier this element. * * @param newId the new identifier of this element */ public final void setId(final String newId) { setAttribute("id", newId); }
/** * Sets the value of this attribute. * @param value the new value of this attribute */ public void jsxSet_value(final String value) { if (parent_ != null) { parent_.setAttribute(name_, value); } else { value_ = value; } }
/** * Sets the identifier this element. * * @param newId the new identifier of this element */ public final void setId(final String newId) { setAttribute("id", newId); }
/** * Sets the value of this attribute. * @param value the new value of this attribute */ public void jsxSet_value(final String value) { if (parent_ != null) { parent_.setAttribute(name_, value); } else { value_ = value; } }
/** * Sets the value of this attribute. * @param value the new value of this attribute */ public void jsxSet_value(final String value) { if (parent_ != null) { parent_.setAttribute(name_, value); } else { value_ = value; } }
DomElement myInput = page.getElementById("someid"); myInput.setAttribute("value", seriesName);
public void setAttribute(String name, String value) { if ("value".equals(name) && element instanceof HtmlInput) { // for HtmlInputs, we want to run any onChange code if the value changes ((HtmlInput) element).setValueAttribute(value); } else { element.setAttribute(name, value); } }
/** * Sets an attribute. * * @param name Name of the attribute to set * @param value Value to set the attribute to */ public void jsxFunction_setAttribute(final String name, final String value) { getDomNodeOrDie().setAttribute(name, value); }
/** * Sets an attribute. * * @param name Name of the attribute to set * @param value Value to set the attribute to */ public void jsxFunction_setAttribute(final String name, final String value) { getDomNodeOrDie().setAttribute(name, value); }
DomNodeList<DomElement> images = result.getElementsByTagName("img"); for (DomElement e : images) { e.setAttribute("src", result.getFullyQualifiedUrl(e.getAttribute("src")).toString()); }
/** * Sets an attribute. * * @param name Name of the attribute to set * @param value Value to set the attribute to */ public void jsxFunction_setAttribute(final String name, final String value) { getDomNodeOrDie().setAttribute(name, value); }
/** * Sets the class attribute for this element. * @param className the new class name */ @JsxSetter(propertyName = "className", value = {CHROME, FF}) public void setClassName_js(final String className) { getDomNodeOrDie().setAttribute("class", className); }
/** * Sets an attribute. * * @param name Name of the attribute to set * @param value Value to set the attribute to */ @JsxFunction public void setAttribute(final String name, final String value) { getDomNodeOrDie().setAttribute(name, value); }
/** * Sets an attribute. * * @param name Name of the attribute to set * @param value Value to set the attribute to */ @JsxFunction public void setAttribute(final String name, final String value) { getDomNodeOrDie().setAttribute(name, value); }
/** * Sets the class attribute for this element. * @param className the new class name */ @JsxSetter(propertyName = "className", value = {CHROME, FF}) public void setClassName_js(final String className) { getDomNodeOrDie().setAttribute("class", className); }
/** * Sets the actual text of the style. * @param value the new text */ @JsxSetter public void setCssText(final String value) { if (styleDeclaration_ != null) { styleDeclaration_.setCssText(value); return; } jsElement_.getDomNodeOrDie().setAttribute("style", value); }
/** * Sets the actual text of the style. * @param value the new text */ @JsxSetter public void setCssText(final String value) { if (styleDeclaration_ != null) { styleDeclaration_.setCssText(value); return; } jsElement_.getDomNodeOrDie().setAttribute("style", value); }
/** * Sets the value of the named attribute. * * @param name the name of the attribute; if the attribute with that name already exists, its value is changed * @param value the value for the named attribute */ @JsxFunction public void setAttribute(final String name, final String value) { if (name == null || "null".equals(name)) { throw Context.reportRuntimeError("Type mismatch."); } if (StringUtils.isEmpty(name)) { throw Context.reportRuntimeError("The empty string '' is not a valid name."); } if (value == null || "null".equals(value)) { throw Context.reportRuntimeError("Type mismatch."); } getDomNodeOrDie().setAttribute(name, value); }
private static void copyAttributes(final DomElement to, final XMLAttributes attrs) { final int length = attrs.getLength(); for (int i = 0; i < length; i++) { final String attrName = attrs.getLocalName(i).toLowerCase(Locale.ROOT); if (to.getAttributes().getNamedItem(attrName) == null) { to.setAttribute(attrName, attrs.getValue(i)); if (attrName.startsWith("on") && to.getScriptableObject() instanceof HTMLBodyElement) { final HTMLBodyElement jsBody = to.getScriptableObject(); jsBody.createEventHandlerFromAttribute(attrName, attrs.getValue(i)); } } } }
private static void copyAttributes(final DomElement to, final XMLAttributes attrs) { final int length = attrs.getLength(); for (int i = 0; i < length; i++) { final String attrName = attrs.getLocalName(i).toLowerCase(Locale.ROOT); if (to.getAttributes().getNamedItem(attrName) == null) { to.setAttribute(attrName, attrs.getValue(i)); if (attrName.startsWith("on") && to.getScriptableObject() instanceof HTMLBodyElement) { final HTMLBodyElement jsBody = to.getScriptableObject(); jsBody.createEventHandlerFromAttribute(attrName, attrs.getValue(i)); } } } }