/** * Sets the value of the "label" property. * @param label the new label property */ public void jsxSet_label(final String label) { getDomNodeOrNull().setLabelAttribute(label); }
/** * Sets the value of the "label" property. * @param label the new label property */ public void jsxSet_label(final String label) { getDomNodeOrNull().setLabelAttribute(label); }
/** * Sets the value of the "label" property. * @param label the new label property */ public void jsxSet_label(final String label) { getDomNodeOrNull().setLabelAttribute(label); }
/** * Sets the value of the {@code label} property. * @param label the new label property */ @JsxSetter public void setLabel(final String label) { final DomNode domNode = getDomNodeOrNull(); if (domNode instanceof HtmlOption) { ((HtmlOption) domNode).setLabelAttribute(label); } else { ((HtmlOptionGroup) domNode).setLabelAttribute(label); } }
/** * Sets the value of the {@code label} property. * @param label the new label property */ @JsxSetter public void setLabel(final String label) { final DomNode domNode = getDomNodeOrNull(); if (domNode instanceof HtmlOption) { ((HtmlOption) domNode).setLabelAttribute(label); } else { ((HtmlOptionGroup) domNode).setLabelAttribute(label); } }
/** * JavaScript constructor. * @param newText the text * @param newValue the value * @param defaultSelected Whether the option is initially selected * @param selected the current selection state of the option */ @JsxConstructor({CHROME, FF, EDGE}) public void jsConstructor(final String newText, final String newValue, final boolean defaultSelected, final boolean selected) { final HtmlPage page = (HtmlPage) getWindow().getWebWindow().getEnclosedPage(); AttributesImpl attributes = null; if (defaultSelected) { attributes = new AttributesImpl(); attributes.addAttribute(null, "selected", "selected", null, "selected"); } final HtmlOption htmlOption = (HtmlOption) HTMLParser.getFactory(HtmlOption.TAG_NAME).createElement( page, HtmlOption.TAG_NAME, attributes); htmlOption.setSelected(selected); setDomNode(htmlOption); if (!"undefined".equals(newText)) { htmlOption.appendChild(new DomText(page, newText)); htmlOption.setLabelAttribute(newText); } if (!"undefined".equals(newValue)) { htmlOption.setValueAttribute(newValue); } }
/** * JavaScript constructor. * @param newText the text * @param newValue the value * @param defaultSelected Whether the option is initially selected * @param selected the current selection state of the option */ @JsxConstructor({CHROME, FF, EDGE}) public void jsConstructor(final String newText, final String newValue, final boolean defaultSelected, final boolean selected) { final HtmlPage page = (HtmlPage) getWindow().getWebWindow().getEnclosedPage(); AttributesImpl attributes = null; if (defaultSelected) { attributes = new AttributesImpl(); attributes.addAttribute(null, "selected", "selected", null, "selected"); } final HtmlOption htmlOption = (HtmlOption) HTMLParser.getFactory(HtmlOption.TAG_NAME).createElement( page, HtmlOption.TAG_NAME, attributes); htmlOption.setSelected(selected); setDomNode(htmlOption); if (!"undefined".equals(newText)) { htmlOption.appendChild(new DomText(page, newText)); htmlOption.setLabelAttribute(newText); } if (!"undefined".equals(newValue)) { htmlOption.setValueAttribute(newValue); } }