/** * Returns whether this Option is selected by default. * That is whether the "selected" * attribute exists when the Option is constructed. This also determines * the value of getSelectedAttribute() after a reset() on the form. * @return whether the option is selected by default */ public final boolean isDefaultSelected() { return hasAttribute("selected"); }
/** * Returns <tt>true</tt> if this option is currently selected. * @return <tt>true</tt> if this option is currently selected */ public boolean isSelected() { return hasAttribute("selected") || selected_; }
/** * Creates an instance. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes the initial attributes */ HtmlOption(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page, attributes); initialSelectedState_ = hasAttribute("selected"); }
/** * Creates an instance. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes the initial attributes */ HtmlOption(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page, attributes); initialSelectedState_ = hasAttribute("selected"); }
/** * Returns whether this Option is selected by default. * That is whether the "selected" * attribute exists when the Option is constructed. This also determines * the value of getSelectedAttribute() after a reset() on the form. * @return whether the option is selected by default */ public final boolean isDefaultSelected() { return hasAttribute("selected"); }
/** * Creates an instance. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes the initial attributes */ HtmlOption(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page, attributes); initialSelectedState_ = hasAttribute("selected"); }
/** * Returns <tt>true</tt> if this option is currently selected. * @return <tt>true</tt> if this option is currently selected */ public boolean isSelected() { return hasAttribute("selected") || selected_; }
/** * Returns <tt>true</tt> if this option is currently selected. * @return <tt>true</tt> if this option is currently selected */ public boolean isSelected() { return hasAttribute("selected") || selected_; }
/** * Resets the option to its original selected state. */ public void reset() { setSelectedInternal(hasAttribute("selected")); }
/** * Resets the option to its original selected state. */ public void reset() { setSelectedInternal(hasAttribute("selected")); }
/** * Returns {@code true} if the disabled attribute is set for this element. Note that this * method always returns {@code false} when emulating IE, because IE does not allow individual * options to be disabled. * * @return {@code true} if the disabled attribute is set for this element (always {@code false} * when emulating IE) */ @Override public final boolean isDisabled() { if (hasFeature(HTMLOPTION_PREVENT_DISABLED)) { return false; } return hasAttribute("disabled"); }
/** * Returns {@code true} if the disabled attribute is set for this element. Note that this * method always returns {@code false} when emulating IE, because IE does not allow individual * options to be disabled. * * @return {@code true} if the disabled attribute is set for this element (always {@code false} * when emulating IE) */ @Override public final boolean isDisabled() { if (hasFeature(HTMLOPTION_PREVENT_DISABLED)) { return false; } return hasAttribute("disabled"); }
/** * Returns <tt>true</tt> if the disabled attribute is set for this element. Note that this * method always returns <tt>false</tt> when emulating IE, because IE does not allow individual * options to be disabled. * * @return <tt>true</tt> if the disabled attribute is set for this element (always <tt>false</tt> * when emulating IE) */ public final boolean isDisabled() { if (getPage().getWebClient().getBrowserVersion().hasFeature( BrowserVersionFeatures.HTMLOPTION_PREVENT_DISABLED)) { return false; } return hasAttribute("disabled"); }
/** * Returns <tt>true</tt> if the disabled attribute is set for this element. Note that this * method always returns <tt>false</tt> when emulating IE, because IE does not allow individual * options to be disabled. * * @return <tt>true</tt> if the disabled attribute is set for this element (always <tt>false</tt> * when emulating IE) */ public final boolean isDisabled() { if (getPage().getWebClient().getBrowserVersion().hasFeature( BrowserVersionFeatures.HTMLOPTION_PREVENT_DISABLED)) { return false; } return hasAttribute("disabled"); }
/** * Returns <tt>true</tt> if the disabled attribute is set for this element. Note that this * method always returns <tt>false</tt> when emulating IE, because IE does not allow individual * options to be disabled. * * @return <tt>true</tt> if the disabled attribute is set for this element (always <tt>false</tt> * when emulating IE) */ public final boolean isDisabled() { if (getPage().getWebClient().getBrowserVersion().hasFeature( BrowserVersionFeatures.HTMLOPTION_PREVENT_DISABLED)) { return false; } return hasAttribute("disabled"); }