Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/org/w3c/dom/html/HTMLSelectElement.java
86410 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/*25* This file is available under and governed by the GNU General Public26* License version 2 only, as published by the Free Software Foundation.27* However, the following notice accompanied the original version of this28* file and, per its terms, should not be removed:29*30* Copyright (c) 2000 World Wide Web Consortium,31* (Massachusetts Institute of Technology, Institut National de32* Recherche en Informatique et en Automatique, Keio University). All33* Rights Reserved. This program is distributed under the W3C's Software34* Intellectual Property License. This program is distributed in the35* hope that it will be useful, but WITHOUT ANY WARRANTY; without even36* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR37* PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more38* details.39*/4041package org.w3c.dom.html;4243import org.w3c.dom.DOMException;4445/**46* The select element allows the selection of an option. The contained47* options can be directly accessed through the select element as a48* collection. See the SELECT element definition in HTML 4.0.49* <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.50*/51public interface HTMLSelectElement extends HTMLElement {52/**53* The type of this form control. This is the string "select-multiple"54* when the multiple attribute is <code>true</code> and the string55* "select-one" when <code>false</code> .56*/57public String getType();5859/**60* The ordinal index of the selected option, starting from 0. The value61* -1 is returned if no element is selected. If multiple options are62* selected, the index of the first selected option is returned.63*/64public int getSelectedIndex();65public void setSelectedIndex(int selectedIndex);6667/**68* The current form control value.69*/70public String getValue();71public void setValue(String value);7273/**74* The number of options in this <code>SELECT</code> .75*/76public int getLength();7778/**79* Returns the <code>FORM</code> element containing this control. Returns80* <code>null</code> if this control is not within the context of a form.81*/82public HTMLFormElement getForm();8384/**85* The collection of <code>OPTION</code> elements contained by this86* element.87*/88public HTMLCollection getOptions();8990/**91* The control is unavailable in this context. See the disabled92* attribute definition in HTML 4.0.93*/94public boolean getDisabled();95public void setDisabled(boolean disabled);9697/**98* If true, multiple <code>OPTION</code> elements may be selected in99* this <code>SELECT</code> . See the multiple attribute definition in100* HTML 4.0.101*/102public boolean getMultiple();103public void setMultiple(boolean multiple);104105/**106* Form control or object name when submitted with a form. See the name107* attribute definition in HTML 4.0.108*/109public String getName();110public void setName(String name);111112/**113* Number of visible rows. See the size attribute definition in HTML 4.0.114*/115public int getSize();116public void setSize(int size);117118/**119* Index that represents the element's position in the tabbing order. See120* the tabindex attribute definition in HTML 4.0.121*/122public int getTabIndex();123public void setTabIndex(int tabIndex);124125/**126* Add a new element to the collection of <code>OPTION</code> elements127* for this <code>SELECT</code> . This method is the equivalent of the128* <code>appendChild</code> method of the <code>Node</code> interface if129* the <code>before</code> parameter is <code>null</code> . It is130* equivalent to the <code>insertBefore</code> method on the parent of131* <code>before</code> in all other cases.132* @param element The element to add.133* @param before The element to insert before, or <code>null</code> for134* the tail of the list.135* @exception DOMException136* NOT_FOUND_ERR: Raised if <code>before</code> is not a descendant of137* the <code>SELECT</code> element.138*/139public void add(HTMLElement element,140HTMLElement before)141throws DOMException;142143/**144* Remove an element from the collection of <code>OPTION</code> elements145* for this <code>SELECT</code> . Does nothing if no element has the given146* index.147* @param index The index of the item to remove, starting from 0.148*/149public void remove(int index);150151/**152* Removes keyboard focus from this element.153*/154public void blur();155156/**157* Gives keyboard focus to this element.158*/159public void focus();160161}162163164