1 20 21 package org.ozoneDB.xml.dom.html; 22 23 import org.ozoneDB.xml.dom.ElementImpl; 24 import org.w3c.dom.html.HTMLButtonElement; 25 26 27 33 public final class HTMLButtonElementImpl extends HTMLElementImpl implements HTMLButtonElement, HTMLFormControl { 34 35 36 public String getAccessKey() { 37 String accessKey; 38 39 accessKey = getAttribute( "accesskey" ); 41 if (accessKey != null && accessKey.length() > 1) { 42 accessKey = accessKey.substring( 0, 1 ); 43 } 44 return accessKey; 45 } 46 47 48 public void setAccessKey( String accessKey ) { 49 if (accessKey != null && accessKey.length() > 1) { 51 accessKey = accessKey.substring( 0, 1 ); 52 } 53 setAttribute( "accesskey", accessKey ); 54 } 55 56 57 public boolean getDisabled() { 58 return getAttribute( "disabled" ) != null; 59 } 60 61 62 public void setDisabled( boolean disabled ) { 63 setAttribute( "disabled", disabled ? "" : null ); 64 } 65 66 67 public String getName() { 68 return getAttribute( "name" ); 69 } 70 71 72 public void setName( String name ) { 73 setAttribute( "name", name ); 74 } 75 76 77 public int getTabIndex() { 78 try { 79 return Integer.parseInt( getAttribute( "tabindex" ) ); 80 } catch (NumberFormatException except) { 81 return 0; 82 } 83 } 84 85 86 public void setTabIndex( int tabIndex ) { 87 setAttribute( "tabindex", String.valueOf( tabIndex ) ); 88 } 89 90 91 public String getType() { 92 return capitalize( getAttribute( "type" ) ); 93 } 94 95 96 public String getValue() { 97 return getAttribute( "value" ); 98 } 99 100 101 public void setValue( String value ) { 102 setAttribute( "value", value ); 103 } 104 105 106 111 public HTMLButtonElementImpl( HTMLDocumentImpl owner, String name ) { 112 super( owner, "BUTTON" ); 113 } 114 115 116 } 117 | Popular Tags |