/** * <p>This method delegates the call to the parent select element.</p> * * <p>See {@link #put(String, Scriptable, Object)} for the corresponding setter behavior.</p> * * @param name {@inheritDoc} * @return {@inheritDoc} */ public Object getWithFallback(final String name) { if (!getBrowserVersion().isIE() && name.equals("childNodes")) { return NOT_FOUND; } // If the name was NOT_FOUND on the prototype, then just drop through // to search on the select element for IE only AND FF. final HTMLSelectElement select = (HTMLSelectElement) htmlSelect_.getScriptObject(); return ScriptableObject.getProperty(select, name); }
/** * <p>This method delegates the call to the parent select element.</p> * * <p>See {@link #put(String, Scriptable, Object)} for the corresponding setter behavior.</p> * * @param name {@inheritDoc} * @return {@inheritDoc} */ public Object getWithFallback(final String name) { if (!getBrowserVersion().isIE() && name.equals("childNodes")) { return NOT_FOUND; } // If the name was NOT_FOUND on the prototype, then just drop through // to search on the select element for IE only AND FF. final HTMLSelectElement select = (HTMLSelectElement) htmlSelect_.getScriptObject(); return ScriptableObject.getProperty(select, name); }
/** * <p>This method delegates the call to the parent select element.</p> * * <p>See {@link #put(String, Scriptable, Object)} for the corresponding setter behavior.</p> * * @param name {@inheritDoc} * @return {@inheritDoc} */ public Object getWithFallback(final String name) { if (!getBrowserVersion().isIE() && name.equals("childNodes")) { return NOT_FOUND; } // If the name was NOT_FOUND on the prototype, then just drop through // to search on the select element for IE only AND FF. final HTMLSelectElement select = (HTMLSelectElement) htmlSelect_.getScriptObject(); return ScriptableObject.getProperty(select, name); }
/** * <p>If IE is emulated, and this class does not have the specified property, and the owning * select *does* have the specified property, this method delegates the call to the parent * select element.</p> * * <p>See {@link #getWithFallback(String)} for the corresponding getter behavior.</p> * * @param name {@inheritDoc} * @param start {@inheritDoc} * @param value {@inheritDoc} */ @Override public void put(final String name, final Scriptable start, final Object value) { if (htmlSelect_ == null) { // This object hasn't been initialized; it's probably being used as a prototype. // Just pretend we didn't even see this invocation and let Rhino handle it. super.put(name, start, value); return; } final HTMLSelectElement parent = (HTMLSelectElement) htmlSelect_.getScriptObject(); if (!has(name, start) && ScriptableObject.hasProperty(parent, name)) { ScriptableObject.putProperty(parent, name, value); } else { super.put(name, start, value); } }
/** * <p>If IE is emulated, and this class does not have the specified property, and the owning * select *does* have the specified property, this method delegates the call to the parent * select element.</p> * * <p>See {@link #getWithFallback(String)} for the corresponding getter behavior.</p> * * @param name {@inheritDoc} * @param start {@inheritDoc} * @param value {@inheritDoc} */ @Override public void put(final String name, final Scriptable start, final Object value) { if (htmlSelect_ == null) { // This object hasn't been initialized; it's probably being used as a prototype. // Just pretend we didn't even see this invocation and let Rhino handle it. super.put(name, start, value); return; } final HTMLSelectElement parent = (HTMLSelectElement) htmlSelect_.getScriptObject(); if (!has(name, start) && ScriptableObject.hasProperty(parent, name)) { ScriptableObject.putProperty(parent, name, value); } else { super.put(name, start, value); } }
/** * <p>If IE is emulated, and this class does not have the specified property, and the owning * select *does* have the specified property, this method delegates the call to the parent * select element.</p> * * <p>See {@link #getWithFallback(String)} for the corresponding getter behavior.</p> * * @param name {@inheritDoc} * @param start {@inheritDoc} * @param value {@inheritDoc} */ @Override public void put(final String name, final Scriptable start, final Object value) { if (htmlSelect_ == null) { // This object hasn't been initialized; it's probably being used as a prototype. // Just pretend we didn't even see this invocation and let Rhino handle it. super.put(name, start, value); return; } final HTMLSelectElement parent = (HTMLSelectElement) htmlSelect_.getScriptObject(); if (!has(name, start) && ScriptableObject.hasProperty(parent, name)) { ScriptableObject.putProperty(parent, name, value); } else { super.put(name, start, value); } }
/** * Sets the index property. * @param index the index * @param start the scriptable object that was originally invoked for this property * @param newValue the new value */ @Override public void put(final int index, final Scriptable start, final Object newValue) { if (newValue == null) { // Remove the indexed option. htmlSelect_.removeOption(index); } else { final HTMLOptionElement option = (HTMLOptionElement) newValue; final HtmlOption htmlOption = option.getDomNodeOrNull(); if (index >= jsxGet_length()) { // Add a new option at the end. htmlSelect_.appendOption(htmlOption); } else { // Replace the indexed option. htmlSelect_.replaceOption(index, htmlOption); } } if (jsxGet_length() == 1 && !htmlSelect_.isMultipleSelectEnabled()) { ((HTMLSelectElement) htmlSelect_.getScriptObject()).jsxSet_selectedIndex(0); } }
/** * Sets the index property. * @param index the index * @param start the scriptable object that was originally invoked for this property * @param newValue the new value */ @Override public void put(final int index, final Scriptable start, final Object newValue) { if (newValue == null) { // Remove the indexed option. htmlSelect_.removeOption(index); } else { final HTMLOptionElement option = (HTMLOptionElement) newValue; final HtmlOption htmlOption = option.getDomNodeOrNull(); if (index >= jsxGet_length()) { // Add a new option at the end. htmlSelect_.appendOption(htmlOption); } else { // Replace the indexed option. htmlSelect_.replaceOption(index, htmlOption); } } if (jsxGet_length() == 1 && !htmlSelect_.isMultipleSelectEnabled()) { ((HTMLSelectElement) htmlSelect_.getScriptObject()).jsxSet_selectedIndex(0); } }
/** * Sets the index property. * @param index the index * @param start the scriptable object that was originally invoked for this property * @param newValue the new value */ @Override public void put(final int index, final Scriptable start, final Object newValue) { if (newValue == null) { // Remove the indexed option. htmlSelect_.removeOption(index); } else { final HTMLOptionElement option = (HTMLOptionElement) newValue; final HtmlOption htmlOption = option.getDomNodeOrNull(); if (index >= jsxGet_length()) { // Add a new option at the end. htmlSelect_.appendOption(htmlOption); } else { // Replace the indexed option. htmlSelect_.replaceOption(index, htmlOption); } } if (jsxGet_length() == 1 && !htmlSelect_.isMultipleSelectEnabled()) { ((HTMLSelectElement) htmlSelect_.getScriptObject()).jsxSet_selectedIndex(0); } }