001    /*
002     * Copyright (c) 2003 World Wide Web Consortium,
003     * (Massachusetts Institute of Technology, Institut National de
004     * Recherche en Informatique et en Automatique, Keio University). All
005     * Rights Reserved. This program is distributed under the W3C's Software
006     * Intellectual Property License. This program is distributed in the
007     * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008     * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009     * PURPOSE.
010     * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
011     */
012    
013    package org.w3c.dom.html2;
014    
015    /**
016     * A selectable choice. See the OPTION element definition in HTML 4.01.
017     * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
018     */
019    public interface HTMLOptionElement extends HTMLElement {
020        /**
021         * Returns the <code>FORM</code> element containing this control. Returns 
022         * <code>null</code> if this control is not within the context of a 
023         * form. 
024         */
025        public HTMLFormElement getForm();
026    
027        /**
028         * Represents the value of the HTML selected attribute. The value of this 
029         * attribute does not change if the state of the corresponding form 
030         * control, in an interactive user agent, changes. See the selected 
031         * attribute definition in HTML 4.01.
032         * @version DOM Level 2
033         */
034        public boolean getDefaultSelected();
035        /**
036         * Represents the value of the HTML selected attribute. The value of this 
037         * attribute does not change if the state of the corresponding form 
038         * control, in an interactive user agent, changes. See the selected 
039         * attribute definition in HTML 4.01.
040         * @version DOM Level 2
041         */
042        public void setDefaultSelected(boolean defaultSelected);
043    
044        /**
045         * The text contained within the option element. 
046         */
047        public String getText();
048    
049        /**
050         * The index of this <code>OPTION</code> in its parent <code>SELECT</code>
051         * , starting from 0.
052         * @version DOM Level 2
053         */
054        public int getIndex();
055    
056        /**
057         * The control is unavailable in this context. See the disabled attribute 
058         * definition in HTML 4.01.
059         */
060        public boolean getDisabled();
061        /**
062         * The control is unavailable in this context. See the disabled attribute 
063         * definition in HTML 4.01.
064         */
065        public void setDisabled(boolean disabled);
066    
067        /**
068         * Option label for use in hierarchical menus. See the label attribute 
069         * definition in HTML 4.01.
070         */
071        public String getLabel();
072        /**
073         * Option label for use in hierarchical menus. See the label attribute 
074         * definition in HTML 4.01.
075         */
076        public void setLabel(String label);
077    
078        /**
079         * Represents the current state of the corresponding form control, in an 
080         * interactive user agent. Changing this attribute changes the state of 
081         * the form control, but does not change the value of the HTML selected 
082         * attribute of the element.
083         */
084        public boolean getSelected();
085        /**
086         * Represents the current state of the corresponding form control, in an 
087         * interactive user agent. Changing this attribute changes the state of 
088         * the form control, but does not change the value of the HTML selected 
089         * attribute of the element.
090         */
091        public void setSelected(boolean selected);
092    
093        /**
094         * The current form control value. See the value attribute definition in 
095         * HTML 4.01.
096         */
097        public String getValue();
098        /**
099         * The current form control value. See the value attribute definition in 
100         * HTML 4.01.
101         */
102        public void setValue(String value);
103    
104    }