001 
002 /*
003  *  JScripter Standard 1.0 - To Script In Java
004  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
005  *  
006  *  This program is free software: you can redistribute it and/or modify
007  *  it under the terms of the GNU Affero General Public License as published by
008  *  the Free Software Foundation, either version 3 of the License, or
009  *  (at your option) any later version.
010  *  
011  *  This program is distributed in the hope that it will be useful,
012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014  *  GNU Affero General Public License for more details.
015  *  
016  *  You should have received a copy of the GNU Affero General Public License
017  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
018  */
019 
020 package js.user;
021 
022 import js.*;
023 import js.core.*;
024 
025 /**
026  * <p>An <b>opaque</b> class representing JavaScript client-side objects of the global 
027  * {@link JsClient#HTMLSelectElement} class.</p>
028  * <p>This class represents a select menu 
029  * in an HTML page, or a {@link JsHTMLElement} object created with the HTML 
030  * <tt>&lt;select&gt;</tt> tag which creates a menu allowing the selection of an option.</p>
031  * <p>The options contained in an object of this class can be directly accessed through 
032  * the select element as a collection of {@link JsHTMLOptionElement}. A menu of {@link JsHTMLSelectElement} 
033  * must contain at least one {@link JsHTMLOptionElement} object. If {@link JsHTMLSelectElement#multiple} 
034  * is <tt>true</tt>, the user may select any number of options from the list. Otherwise, 
035  * the user may select only one option, and options have a radio-button behavior, that is, 
036  * selecting one deselects whichever was previously selected.</p>
037  * <p>The options in an element of this class may be displayed in two distinct ways. 
038  * When {@link JsHTMLSelectElement#size} is greater than 1 or {@link JsHTMLSelectElement#multiple} 
039  * is <tt>true</tt>, they are displayed in a list box that is {@link JsHTMLSelectElement#size} 
040  * lines high in the browser window. When {@link JsHTMLSelectElement#size} is smaller than 
041  * the number of options, the listbox includes a scrollbar so all the options are 
042  * accessible. On the contrary, when {@link JsHTMLSelectElement#size} is specified as 1 
043  * and {@link JsHTMLSelectElement#multiple} is <tt>false</tt> or not specified, the 
044  * currently selected option is displayed on a single line, and the list of other options 
045  * is made available through a drop-down menu. The first style displays the options 
046  * clearly but requires more space in the browser window. The second requires minimal 
047  * space but does not display alternative options explicitly.</p>
048  * <p>If {@link JsHTMLSelectElement#multiple} is <tt>false</tt> or undefined, you can 
049  * determine which option is selected with the {@link JsHTMLSelectElement#selectedIndex} 
050  * property. Otherwise, {@link JsHTMLSelectElement#selectedIndex} tells you the index 
051  * of only the first selected option. To determine the full set of selected options, 
052  * you must iterate through the {@link JsHTMLSelectElement#options} array and check the 
053  * {@link JsHTMLOptionElement#selected} property of each {@link JsHTMLOptionElement} 
054  * object.</p>
055  * <p>The options displayed by the element of this class may be dynamically modified. 
056  * Add a new option with {@link JsHTMLSelectElement#add(JsHTMLElement, JsHTMLElement)}. 
057  * Remove an option with {@link JsHTMLSelectElement#remove(Number)}. Changes can also 
058  * be made by direct manipulation of the {@link JsHTMLSelectElement#options} array.</p>
059  *
060  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
061  * @see JsHTMLOptionElement
062  * @see JsHTMLOptGroupElement
063  *
064  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
065  * generated into the target codes. Re-compilers must exit with error on the operations of
066  * accessing that kind of class objects.
067  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
068  * and <tt>instanceof</tt> to it always <tt>true</tt>.
069  */
070 public class JsHTMLSelectElement extends JsClient.HTMLSelectElement.Prototype
071 {
072     /**
073      * <p>An <b>internal</b> class containing membership data for its enclosing
074      * opaque class.</p>
075      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
076      * class members.</p>
077      *
078      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
079      * 
080      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
081      */
082     protected static abstract class Members extends JsClient.HTMLSelectElement.Prototype.Members
083     {
084         /**
085          * <p>An <b>internal</b> static field defining a member ID of the field name and
086          * used internally to define a member of the same name.</p>
087          * @since 1.0
088          * @see JsHTMLSelectElement#form
089          * @see JsHTMLSelectElement.Member#form
090          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
091          */
092         public final static Mid form          = id("form"         );
093         /**
094          * <p>An <b>internal</b> static field defining a member ID of the field name and
095          * used internally to define a member of the same name.</p>
096          * @since 1.0
097          * @see JsHTMLSelectElement#length
098          * @see JsHTMLSelectElement.Member#length
099          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
100          */
101         public final static Mid length        = id("length"       );
102         /**
103          * <p>An <b>internal</b> static field defining a member ID of the field name and
104          * used internally to define a member of the same name.</p>
105          * @since 1.0
106          * @see JsHTMLSelectElement#options
107          * @see JsHTMLSelectElement.Member#options
108          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
109          */
110         public final static Mid options       = id("options"      );
111         /**
112          * <p>An <b>internal</b> static field defining a member ID of the field name and
113          * used internally to define a member of the same name.</p>
114          * @since 1.0
115          * @see JsHTMLSelectElement#selectedIndex
116          * @see JsHTMLSelectElement.Member#selectedIndex
117          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
118          */
119         public final static Mid selectedIndex = id("selectedIndex");
120         /**
121          * <p>An <b>internal</b> static field defining a member ID of the field name and
122          * used internally to define a member of the same name.</p>
123          * @since 1.0
124          * @see JsHTMLSelectElement#type
125          * @see JsHTMLSelectElement.Member#type
126          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
127          */
128         public final static Mid type          = id("type"         );
129         /**
130          * <p>An <b>internal</b> static field defining a member ID of the field name and
131          * used internally to define a member of the same name.</p>
132          * @since 1.0
133          * @see JsHTMLSelectElement#disabled
134          * @see JsHTMLSelectElement.Member#disabled
135          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
136          */
137         public final static Mid disabled      = id("disabled"     );
138         /**
139          * <p>An <b>internal</b> static field defining a member ID of the field name and
140          * used internally to define a member of the same name.</p>
141          * @since 1.0
142          * @see JsHTMLSelectElement#multiple
143          * @see JsHTMLSelectElement.Member#multiple
144          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
145          */
146         public final static Mid multiple      = id("multiple"     );
147         /**
148          * <p>An <b>internal</b> static field defining a member ID of the field name and
149          * used internally to define a member of the same name.</p>
150          * @since 1.0
151          * @see JsHTMLSelectElement#name
152          * @see JsHTMLSelectElement.Member#name
153          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
154          */
155         public final static Mid name          = id("name"         );
156         /**
157          * <p>An <b>internal</b> static field defining a member ID of the field name and
158          * used internally to define a member of the same name.</p>
159          * @since 1.0
160          * @see JsHTMLSelectElement#size
161          * @see JsHTMLSelectElement.Member#size
162          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
163          */
164         public final static Mid size          = id("size"         );
165         /**
166          * <p>An <b>internal</b> static field defining a member ID of the field name and
167          * used internally to define a member of the same name.</p>
168          * @since 1.0
169          * @see JsHTMLSelectElement#tabIndex
170          * @see JsHTMLSelectElement.Member#tabIndex
171          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
172          */
173         public final static Mid tabIndex      = id("tabIndex"     );
174         /**
175          * <p>An <b>internal</b> static field defining a member ID of the field name and
176          * used internally to define a member of the same name.</p>
177          * @since 1.0
178          * @see JsHTMLSelectElement#onchange
179          * @see JsHTMLSelectElement.Member#onchange
180          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
181          */
182         public final static Mid onchange      = id("onchange"     );
183     }
184 
185     /**
186      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
187      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
188      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
189      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
190      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
191      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
192      * either circumstance, the field names must be exactly same as the member names, as 
193      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
194      * based on the field names.</p>
195      *
196      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
197      * 
198      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
199      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
200      * of class objects.
201      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
202      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
203      * <pre>q.m</pre>
204      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
205      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
206      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
207      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
208      * <pre>m</pre>
209      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
210      * error on the access to <b>opaque</b> fields declared by this class under any other 
211      * circumstances.
212      */
213     public static class Member extends JsClient.HTMLSelectElement.Prototype.Member
214     {
215         /**
216          * <p>Internally constructs a member based on a qualifying member.</p>
217          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
218          * or <b>internal</b> classes or class members.</p>
219          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
220          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
221          * declared in the declaring class of this constructor itself or its subclasses. 
222          * Under this circumstance, the field names must be exactly same as the member 
223          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
224          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
225          * to their names appending to the name resolved from the specified qualifying 
226          * member with a dot in between.</p>
227          * @param q A qualifying member
228          * @param mid The ID of the member to construct
229          * @since 1.0
230          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
231          */
232         public Member(JsObject.Member q, Mid mid) {
233             super(q, mid);
234         }
235         /**
236          * <p>Internally constructs a member without a qualifying member.</p>
237          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
238          * or <b>internal</b> classes or class members.</p>
239          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
240          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
241          * declared in <b>opaque</b> types other than the declaring class of this constructor 
242          * itself and its subclasses. Under this circumstance, the field names must be
243          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
244          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
245          * @param mid The ID of the member to construct
246          * @since 1.0
247          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
248          */
249         public Member(Mid mid) {
250             super(mid);
251         }
252         @Override
253         /**
254          * <p>Evaluates the property, represented by the current member instance, of the
255          * argument object.</p>
256          * @param o The argument object
257          * @return The value of the current member based on the object argument.
258          * @since 1.0
259          * @javascript Re-compilers must convert the instance invocation of this method into
260          * the JavaScript expression: 
261          * <pre>o.m</pre>
262          * where <tt>m</tt> is the identifier name resolved from the current member
263          * instance of the invocation.
264          */
265         public JsHTMLSelectElement with(ObjectLike o) {
266             return new JsHTMLSelectElement(super.with(o));
267         }
268 
269         /**
270          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
271          * name of this field, qualified by the current member instance of the field, and 
272          * to access the property of the name on an object.</p>
273          * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
274          * object refers to an integer value specifying the number of options in the 
275          * select menu.</p> 
276          * @since 1.0
277          * @see JsHTMLSelectElement#length()
278          * @javascript Re-compilers must resolve the member of this instance field to the
279          * identifier of the field name appending to the identifier resolved from its 
280          * qualifying member with a dot in between.
281          */
282         public final Value.Number.Member length        = new Value.Number.Member(this, Members.length       );
283         /**
284          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
285          * name of this field, qualified by the current member instance of the field, and 
286          * to access the property of the name on an object.</p>
287          * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
288          * object refers to an integer value specifying the ordinal index of the selected 
289          * option, starting from 0. The value is -1 if no element is selected and is the 
290          * index of the first selected option if {@link #multiple} options are selected.</p>
291          * <p>Setting the value of this property selects the specified option and 
292          * deselects all other options, even if the {@link JsHTMLSelectElement} object 
293          * has the {@link #multiple} attribute specified. When you're selecting an option 
294          * and when {@link #size} > 1, you can deselect all options by setting {@link #selectedIndex} 
295          * to -1. Note that changing the selection in this way does not trigger the {@link #onchange} 
296          * event handler.</p> 
297          * @since 1.0
298          * @javascript Re-compilers must resolve the member of this instance field to the
299          * identifier of the field name appending to the identifier resolved from its 
300          * qualifying member with a dot in between.
301          */
302         public final Value.Number.Member selectedIndex = new Value.Number.Member(this, Members.selectedIndex);
303         /**
304          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
305          * name of this field, qualified by the current member instance of the field, and 
306          * to access the property of the name on an object.</p>
307          * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
308          * object refers to a read-only string specifying the type of this form control. 
309          * It is the string "select-multiple" when the {@link #multiple} attribute is 
310          * <tt>true</tt> and the string "select-one" when <tt>false</tt>.</p> 
311          * @since 1.0
312          * @javascript Re-compilers must resolve the member of this instance field to the
313          * identifier of the field name appending to the identifier resolved from its 
314          * qualifying member with a dot in between.
315          */
316         public final Value.String.Member type          = new Value.String.Member(this, Members.type         );
317         /**
318          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
319          * name of this field, qualified by the current member instance of the field, and 
320          * to access the property of the name on an object.</p>
321          * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
322          * object refers to a string specifying the name of the input control when 
323          * submitted with the {@link #form}.</p>
324          * @since 1.0
325          * @javascript Re-compilers must resolve the member of this instance field to the
326          * identifier of the field name appending to the identifier resolved from its 
327          * qualifying member with a dot in between.
328          */
329         public final Value.String.Member name          = new Value.String.Member(this, Members.name         );
330         /**
331          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
332          * name of this field, qualified by the current member instance of the field, and 
333          * to access the property of the name on an object.</p>
334          * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
335          * object refers to an integer value specifying the number of visible rows, that 
336          * is, the number of options to display at once.</p> 
337          * @since 1.0
338          * @javascript Re-compilers must resolve the member of this instance field to the
339          * identifier of the field name appending to the identifier resolved from its 
340          * qualifying member with a dot in between.
341          */
342         public final Value.Number.Member size          = new Value.Number.Member(this, Members.size         );
343         /**
344          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
345          * name of this field, qualified by the current member instance of the field, and 
346          * to access the property of the name on an object.</p>
347          * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
348          * object refers to an index number representing the element's position in the 
349          * tabbing order.</p>
350          * @since 1.0
351          * @javascript Re-compilers must resolve the member of this instance field to the
352          * identifier of the field name appending to the identifier resolved from its 
353          * qualifying member with a dot in between.
354          */
355         public final Value.Number.Member tabIndex      = new Value.Number.Member(this, Members.tabIndex     );
356         /**
357          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
358          * name of this field, qualified by the current member instance of the field, and 
359          * to access the property of the name on an object.</p>
360          * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
361          * object refers to a boolean value that specifies whether the element is 
362          * disabled and is unavailable for user input.</p> 
363          * @since 1.0
364          * @javascript Re-compilers must resolve the member of this instance field to the
365          * identifier of the field name appending to the identifier resolved from its 
366          * qualifying member with a dot in between.
367          */
368         public final Value.Boolean.Member disabled = new Value.Boolean.Member(this, Members.disabled);
369         /**
370          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
371          * name of this field, qualified by the current member instance of the field, and 
372          * to access the property of the name on an object.</p>
373          * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
374          * object refers to a boolean value that specifies whether multiple options may 
375          * be selected in this select menu.</p> 
376          * @since 1.0
377          * @javascript Re-compilers must resolve the member of this instance field to the
378          * identifier of the field name appending to the identifier resolved from its 
379          * qualifying member with a dot in between.
380          */
381         public final Value.Boolean.Member multiple = new Value.Boolean.Member(this, Members.multiple);
382         /**
383          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
384          * name of this field, qualified by the current member instance of the field, and 
385          * to access the property of the name on an object.</p>
386          * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
387          * object is a read-only reference to the {@link JsHTMLFormElement} object 
388          * containing the control. It is <tt>null</tt> if the control is not within the 
389          * context of a form.</p>
390          * @since 1.0
391          * @javascript Re-compilers must resolve the member of this instance field to the
392          * identifier of the field name appending to the identifier resolved from its 
393          * qualifying member with a dot in between.
394          */
395         public final JsHTMLFormElement.Member form = new JsHTMLFormElement.Member(this, Members.form);
396         /**
397          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
398          * name of this field, qualified by the current member instance of the field, and 
399          * to access the property of the name on an object.</p>
400          * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
401          * object is a read-only reference to the collection of {@link JsHTMLOptionElement} 
402          * objects contained in the select menu, in the order in which they appear.</p>
403          * @since 1.0
404          * @javascript Re-compilers must resolve the member of this instance field to the
405          * identifier of the field name appending to the identifier resolved from its 
406          * qualifying member with a dot in between.
407          */
408         public final JsHTMLCollection.Member<JsHTMLOptionElement> options = new JsHTMLCollection.Member<JsHTMLOptionElement>(this, Members.options);
409         /**
410          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
411          * name of this field, qualified by the current member instance of the field, and 
412          * to access the property of the name on an object.</p>
413          * <p>The property, identified by this member, of a {@link JsHTMLInputElement} object is a 
414          * reference to an event handler function invoked when the user selects or deselects an 
415          * item.</p> 
416          * @since 1.0
417          * @see JsElement#addEventListener(String, JsFunction, Boolean)
418          * @see JsElement#attachEvent(String, JsFunction)
419          * @javascript Re-compilers must resolve the member of this instance field to the
420          * identifier of the field name appending to the identifier resolved from its 
421          * qualifying member with a dot in between.
422          */
423         public final JsFunction.Member<?> onchange = new JsFunction.Member<Object>(this, Members.onchange);
424     }
425 
426     /**
427      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it
428      * with the wrapping constructor.</p>
429      * @param var The argument of an <b>opaque</b> object.
430      * @since 1.0
431      * @javascript Re-compilers must ignore the construction operation of this constructor,
432      * that is, replacing it with its only argument.
433      */
434     public JsHTMLSelectElement(JsObject var) {
435         super(var);
436     }
437 
438     /**
439      * <p>An <b>opaque</b> static field defining a member that is named by the field name
440      * without a qualifying member and to access the property of the name on an object.</p>
441      * @since 1.0
442      * @see #length()
443      * @javascript Re-compilers must resolve the member of this static field to the
444      * identifier of the field name.
445      */
446     public static final Value.Number.Member length        = new Value.Number.Member(Members.length       );
447     /**
448      * <p>An <b>opaque</b> static field defining a member that is named by the field name
449      * without a qualifying member and to access the property of the name on an object.</p>
450      * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
451      * object refers to an integer value specifying the ordinal index of the selected 
452      * option, starting from 0. The value is -1 if no element is selected and is the 
453      * index of the first selected option if {@link #multiple} options are selected.</p> 
454      * <p>Setting the value of this property selects the specified option and 
455      * deselects all other options, even if the {@link JsHTMLSelectElement} object 
456      * has the {@link #multiple} attribute specified. When you're selecting an option 
457      * and when {@link #size} > 1, you can deselect all options by setting {@link #selectedIndex} 
458      * to -1. Note that changing the selection in this way does not trigger the {@link #onchange} 
459      * event handler.</p> 
460      * @since 1.0
461      * @javascript Re-compilers must resolve the member of this static field to the
462      * identifier of the field name.
463      */
464     public static final Value.Number.Member selectedIndex = new Value.Number.Member(Members.selectedIndex);
465     /**
466      * <p>An <b>opaque</b> static field defining a member that is named by the field name
467      * without a qualifying member and to access the property of the name on an object.</p>
468      * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
469      * object refers to a read-only string specifying the type of this form control. 
470      * It is the string "select-multiple" when the {@link #multiple} attribute is 
471      * <tt>true</tt> and the string "select-one" when <tt>false</tt>.</p> 
472      * @since 1.0
473      * @javascript Re-compilers must resolve the member of this static field to the
474      * identifier of the field name.
475      */
476     public static final Value.String.Member type          = new Value.String.Member(Members.type         );
477     /**
478      * <p>An <b>opaque</b> static field defining a member that is named by the field name
479      * without a qualifying member and to access the property of the name on an object.</p>
480      * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
481      * object refers to a string specifying the name of the input control when 
482      * submitted with the {@link #form}.</p>
483      * @since 1.0
484      * @javascript Re-compilers must resolve the member of this static field to the
485      * identifier of the field name.
486      */
487     public static final Value.String.Member name          = new Value.String.Member(Members.name         );
488     /**
489      * <p>An <b>opaque</b> static field defining a member that is named by the field name
490      * without a qualifying member and to access the property of the name on an object.</p>
491      * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
492      * object refers to an integer value specifying the number of visible rows, that 
493      * is, the number of options to display at once.</p> 
494      * @since 1.0
495      * @javascript Re-compilers must resolve the member of this static field to the
496      * identifier of the field name.
497      */
498     public static final Value.Number.Member size          = new Value.Number.Member(Members.size         );
499     /**
500      * <p>An <b>opaque</b> static field defining a member that is named by the field name
501      * without a qualifying member and to access the property of the name on an object.</p>
502      * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
503      * object refers to an index number representing the element's position in the 
504      * tabbing order.</p>
505      * @since 1.0
506      * @javascript Re-compilers must resolve the member of this static field to the
507      * identifier of the field name.
508      */
509     public static final Value.Number.Member tabIndex      = new Value.Number.Member(Members.tabIndex     );
510     /**
511      * <p>An <b>opaque</b> static field defining a member that is named by the field name
512      * without a qualifying member and to access the property of the name on an object.</p>
513      * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
514      * object refers to a boolean value that specifies whether the element is 
515      * disabled and is unavailable for user input.</p> 
516      * @since 1.0
517      * @javascript Re-compilers must resolve the member of this static field to the
518      * identifier of the field name.
519      */
520     public static final Value.Boolean.Member disabled = new Value.Boolean.Member(Members.disabled);
521     /**
522      * <p>An <b>opaque</b> static field defining a member that is named by the field name
523      * without a qualifying member and to access the property of the name on an object.</p>
524      * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
525      * object refers to a boolean value that specifies whether multiple options may 
526      * be selected in this select menu.</p> 
527      * @since 1.0
528      * @javascript Re-compilers must resolve the member of this static field to the
529      * identifier of the field name.
530      */
531     public static final Value.Boolean.Member multiple = new Value.Boolean.Member(Members.multiple);
532     /**
533      * <p>An <b>opaque</b> static field defining a member that is named by the field name
534      * without a qualifying member and to access the property of the name on an object.</p>
535      * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
536      * object is a read-only reference to the {@link JsHTMLFormElement} object 
537      * containing the control. It is <tt>null</tt> if the control is not within the 
538      * context of a form.</p>
539      * @since 1.0
540      * @javascript Re-compilers must resolve the member of this static field to the
541      * identifier of the field name.
542      */
543     public static final JsHTMLFormElement.Member form = new JsHTMLFormElement.Member(Members.form);
544     /**
545      * <p>An <b>opaque</b> static field defining a member that is named by the field name
546      * without a qualifying member and to access the property of the name on an object.</p>
547      * <p>The property, identified by this member, of a {@link JsHTMLSelectElement} 
548      * object is a read-only reference to the collection of {@link JsHTMLOptionElement} 
549      * objects contained in the select menu, in the order in which they appear.</p>
550      * @since 1.0
551      * @javascript Re-compilers must resolve the member of this static field to the
552      * identifier of the field name.
553      */
554     public static final JsHTMLCollection.Member<JsHTMLOptionElement> options = new JsHTMLCollection.Member<JsHTMLOptionElement>(Members.options);
555     /**
556      * <p>An <b>opaque</b> static field defining a member that is named by the field name
557      * without a qualifying member and to access the property of the name on an object.</p>
558      * <p>The property, identified by this member, of a {@link JsHTMLInputElement} object is a 
559      * reference to an event handler function invoked when the user selects or deselects an 
560      * item.</p> 
561      * @since 1.0
562      * @see JsElement#addEventListener(String, JsFunction, Boolean)
563      * @see JsElement#attachEvent(String, JsFunction)
564      * @javascript Re-compilers must resolve the member of this static field to the
565      * identifier of the field name.
566      */
567     public static final JsFunction.Member<?> onchange = new JsFunction.Member<Object>(Members.onchange);
568 
569     @Override
570     /**
571      * <p>Returns the primitive value associated with the current instance, if there is one.
572      * This invocation simply returns the instance itself for the current instance is an 
573      * object and there is no primitive value for it.</p>
574      * @return The current object itself.
575      * @since 1.0
576      * @javascript Re-compilers must convert the instance invocation of this method directly
577      * into a JavaScript invocation on its current object instance without changing the 
578      * method name, but expanding variable arguments, if any, into comma-separated values. 
579      */
580     public JsHTMLSelectElement valueOf() {
581         return new JsHTMLSelectElement((JsObject)var().valueOf());
582     }
583 
584     /**
585      * <p>Gets the number of options contained in the current select menu. Same as the 
586      * length of {@link #options}.</p>
587      * @return The number of options contained in the current select element.
588      * @since 1.0
589      * @javascript Re-compilers must convert the instance invocation of this method into the 
590      * JavaScript expression: 
591      * <pre>a.length</pre>
592      * where <tt>a</tt> is the current array instance of the invocation.
593      */
594     public int length() {
595         return length.with(this).intValue();
596     }
597     /**
598      * <p>Inserts a new {@link JsHTMLOptionElement} object into the {@link #options} 
599      * array, either by appending it at the end of the array or by inserting it before 
600      * another specified option.</p>
601      * @param element The {@link JsHTMLOptionElement} object to be added. 
602      * @param before The element of the {@link #options} array before which the new 
603      * <tt>element</tt> should be added. If this argument is <tt>null</tt> or undefined, 
604      * the <tt>element</tt> is appended at the end of the {@link #options} array. 
605      * @throws RuntimeException JavaScript throws a {@link JsDOMException} object with 
606      * the {@link JsDOMException#code} property of the value {@link JsDOMException#NOT_FOUND_ERR} 
607      * if <tt>before</tt> is not a member of the {@link #options} array. See {@link Js#err(Object)} for 
608      * JS Simulation.
609      * @since 1.0
610      * @javascript Re-compilers must convert the instance invocation of this method directly
611      * into a JavaScript invocation on its current object instance without changing the 
612      * method name, but expanding variable arguments, if any, into comma-separated values. 
613      */
614     public final void add(JsHTMLElement element, JsHTMLElement before) {
615         call(add, new Vars<Object>().add(element).add(before));
616     }
617     /**
618      * <p>Takes keyboard focus away from the input control element.</p>
619      * @since 1.0
620      * @javascript Re-compilers must convert the instance invocation of this method directly
621      * into a JavaScript invocation on its current object instance without changing the 
622      * method name, but expanding variable arguments, if any, into comma-separated values. 
623      */
624     public final void blur() {
625         call(blur);
626     }
627     /**
628      * <p>Gives keyboard focus to this input control element.</p>
629      * @since 1.0
630      * @javascript Re-compilers must convert the instance invocation of this method directly
631      * into a JavaScript invocation on its current object instance without changing the 
632      * method name, but expanding variable arguments, if any, into comma-separated values. 
633      */
634     public final void focus() {
635         call(focus);
636     }
637     /**
638      * <p>Removes the option element at the specified position.</p>
639      * @param index The position within the {@link #options} array of the option element 
640      * to be removed.
641      * @since 1.0
642      * @see #remove(NumberLike)
643      * @javascript Re-compilers must convert the instance invocation of this method directly
644      * into a JavaScript invocation on its current object instance without changing the 
645      * method name, but expanding variable arguments, if any, into comma-separated values. 
646      */
647     public final void remove(Number index) {
648         call(remove, index);
649     }
650     /**
651      * <p>Removes the option element at the specified position.</p>
652      * @param index The position within the {@link #options} array of the option element 
653      * to be removed.
654      * @since 1.0
655      * @see #remove(Number)
656      * @javascript Re-compilers must convert the instance invocation of this method directly
657      * into a JavaScript invocation on its current object instance without changing the 
658      * method name, but expanding variable arguments, if any, into comma-separated values. 
659      */
660     public final void remove(NumberLike<?> index) {
661         call(remove, index);
662     }
663 }