1 24 25 package org.enhydra.xml.xhtml.dom.xerces; 26 27 import org.w3c.dom.Node ; 28 import org.w3c.dom.NodeList ; 29 import org.w3c.dom.html.HTMLCollection; 30 import org.w3c.dom.html.HTMLElement; 31 import org.w3c.dom.html.HTMLOptionElement; 32 33 public class XHTMLSelectElementImpl 34 extends XHTMLElementImpl 35 implements org.enhydra.xml.xhtml.dom.XHTMLSelectElement 36 { 37 38 public XHTMLSelectElementImpl (XHTMLDocumentBase owner, String namespaceURI, String tagName) { 39 super( owner, namespaceURI, tagName); 40 } 41 42 46 public NodeList getChildNodes() { 47 return getChildNodesUnoptimized(); 48 } 49 50 public void setId (String newValue) { 51 setAttribute("id", newValue); 52 } 53 54 public String getId () { 55 return getAttribute ("id"); 56 } 57 public void setLang (String newValue) { 58 setAttribute("lang", newValue); 59 } 60 61 public String getLang () { 62 return getAttribute ("lang"); 63 } 64 public void setDir (String newValue) { 65 setAttribute("dir", newValue); 66 } 67 68 public String getDir () { 69 return getAttribute ("dir"); 70 } 71 public void setClassName (String newValue) { 72 setAttribute("class", newValue); 73 } 74 75 public String getClassName () { 76 return getAttribute ("class"); 77 } 78 public void setTitle (String newValue) { 79 setAttribute("title", newValue); 80 } 81 82 public String getTitle () { 83 return getAttribute ("title"); 84 } 85 public void setName (String newValue) { 86 setAttribute("name", newValue); 87 } 88 89 public String getName () { 90 return getAttribute ("name"); 91 } 92 public void setValue (String newValue) { 93 setAttribute("value", newValue); 94 } 95 96 public String getValue () { 97 return getAttribute ("value"); 98 } 99 public void setType (String newValue) { 100 setAttribute("type", newValue); 101 } 102 103 public String getType () { 104 return getAttribute ("type"); 105 } 106 public void setSize (int newValue) { 107 setAttribute("size", newValue); 108 } 109 110 public int getSize () { 111 return getIntAttribute ("size"); 112 } 113 public void setTabIndex (int newValue) { 114 setAttribute("tabindex", newValue); 115 } 116 117 public int getTabIndex () { 118 return getIntAttribute ("tabindex"); 119 } 120 public void setDisabled (boolean newValue) { 121 setAttribute("disabled", newValue); 122 } 123 124 public boolean getDisabled () { 125 return getBooleanAttribute("disabled"); 126 } 127 public void setMultiple (boolean newValue) { 128 setAttribute("multiple", newValue); 129 } 130 131 public boolean getMultiple () { 132 return getBooleanAttribute("multiple"); 133 } 134 public void setOnKeyUp (String newValue) { 135 setAttribute("onkeyup", newValue); 136 } 137 138 public String getOnKeyUp () { 139 return getAttribute ("onkeyup"); 140 } 141 public void setStyle (String newValue) { 142 setAttribute("style", newValue); 143 } 144 145 public String getStyle () { 146 return getAttribute ("style"); 147 } 148 public void setOnMouseDown (String newValue) { 149 setAttribute("onmousedown", newValue); 150 } 151 152 public String getOnMouseDown () { 153 return getAttribute ("onmousedown"); 154 } 155 public void setOnKeyPress (String newValue) { 156 setAttribute("onkeypress", newValue); 157 } 158 159 public String getOnKeyPress () { 160 return getAttribute ("onkeypress"); 161 } 162 public void setOnDblClick (String newValue) { 163 setAttribute("ondblclick", newValue); 164 } 165 166 public String getOnDblClick () { 167 return getAttribute ("ondblclick"); 168 } 169 public void setOnKeyDown (String newValue) { 170 setAttribute("onkeydown", newValue); 171 } 172 173 public String getOnKeyDown () { 174 return getAttribute ("onkeydown"); 175 } 176 public void setOnMouseMove (String newValue) { 177 setAttribute("onmousemove", newValue); 178 } 179 180 public String getOnMouseMove () { 181 return getAttribute ("onmousemove"); 182 } 183 public void setOnMouseUp (String newValue) { 184 setAttribute("onmouseup", newValue); 185 } 186 187 public String getOnMouseUp () { 188 return getAttribute ("onmouseup"); 189 } 190 public void setXmlLang (String newValue) { 191 setAttribute("xml:lang", newValue); 192 } 193 194 public String getXmlLang () { 195 return getAttribute ("xml:lang"); 196 } 197 public void setOnMouseOut (String newValue) { 198 setAttribute("onmouseout", newValue); 199 } 200 201 public String getOnMouseOut () { 202 return getAttribute ("onmouseout"); 203 } 204 public void setOnClick (String newValue) { 205 setAttribute("onclick", newValue); 206 } 207 208 public String getOnClick () { 209 return getAttribute ("onclick"); 210 } 211 public void setOnMouseOver (String newValue) { 212 setAttribute("onmouseover", newValue); 213 } 214 215 public String getOnMouseOver () { 216 return getAttribute ("onmouseover"); 217 } 218 public void setOnBlur (String newValue) { 219 setAttribute("onblur", newValue); 220 } 221 222 public String getOnBlur () { 223 return getAttribute ("onblur"); 224 } 225 public void setOnFocus (String newValue) { 226 setAttribute("onfocus", newValue); 227 } 228 229 public String getOnFocus () { 230 return getAttribute ("onfocus"); 231 } 232 public void setOnChange (String newValue) { 233 setAttribute("onchange", newValue); 234 } 235 236 public String getOnChange () { 237 return getAttribute ("onchange"); 238 } 239 ; 240 241 242 public int getLength() { 243 return getOptions().getLength(); 244 } 245 246 public int getSelectedIndex() { 247 NodeList options; 248 int i; 249 250 options = getElementsByTagName( "OPTION" ); 256 for ( i = 0 ; i < options.getLength() ; ++i ) 257 if ( ( (HTMLOptionElement) options.item( i ) ).getSelected() ) 258 return i; 259 return -1; 260 } 261 262 263 public void setSelectedIndex( int selectedIndex ) { 264 NodeList options; 265 int i; 266 267 options = getElementsByTagName( "OPTION" ); 273 for ( i = 0 ; i < options.getLength() ; ++i ) 274 ( (XHTMLOptionElementImpl) options.item( i ) ).setSelected( i == selectedIndex ); 275 } 276 277 278 public HTMLCollection getOptions() { 279 if ( _options == null ) 280 _options = new XHTMLCollectionImpl( this, XHTMLCollectionImpl.OPTION ); 281 return _options; 282 } 283 284 public void add( HTMLElement element, HTMLElement before ) { 285 insertBefore( element, before ); 286 } 287 288 public void remove( int index ) { 289 NodeList options; 290 Node removed; 291 292 options = getElementsByTagName( "OPTION" ); 298 removed = options.item( index ); 299 if ( removed != null ) 300 removed.getParentNode().removeChild ( removed ); 301 } 302 303 public void blur() { 304 } 306 307 308 public void focus() { 309 } 311 312 private HTMLCollection _options; 313 314 315 ; 316 } 317 318 319 | Popular Tags |