1 57 package org.enhydra.apache.html.dom; 58 59 60 import org.enhydra.apache.xerces.dom.ElementImpl; 61 import org.w3c.dom.html.HTMLButtonElement; 62 63 64 70 public class HTMLButtonElementImpl 71 extends HTMLElementImpl 72 implements HTMLButtonElement, HTMLFormControl 73 { 74 75 76 public String getAccessKey() 77 { 78 String accessKey; 79 80 accessKey = getAttribute( "accesskey" ); 82 if ( accessKey != null && accessKey.length() > 1 ) 83 accessKey = accessKey.substring( 0, 1 ); 84 return accessKey; 85 } 86 87 88 public void setAccessKey( String accessKey ) 89 { 90 if ( accessKey != null && accessKey.length() > 1 ) 92 accessKey = accessKey.substring( 0, 1 ); 93 setAttribute( "accesskey", accessKey ); 94 } 95 96 97 public boolean getDisabled() 98 { 99 return getBinary( "disabled" ); 100 } 101 102 103 public void setDisabled( boolean disabled ) 104 { 105 setAttribute( "disabled", disabled ); 106 } 107 108 109 public String getName() 110 { 111 return getAttribute( "name" ); 112 } 113 114 115 public void setName( String name ) 116 { 117 setAttribute( "name", name ); 118 } 119 120 121 public int getTabIndex() 122 { 123 try 124 { 125 return Integer.parseInt( getAttribute( "tabindex" ) ); 126 } 127 catch ( NumberFormatException except ) 128 { 129 return 0; 130 } 131 } 132 133 134 public void setTabIndex( int tabIndex ) 135 { 136 setAttribute( "tabindex", String.valueOf( tabIndex ) ); 137 } 138 139 140 public String getType() 141 { 142 return capitalize( getAttribute( "type" ) ); 143 } 144 145 146 public String getValue() 147 { 148 return getAttribute( "value" ); 149 } 150 151 152 public void setValue( String value ) 153 { 154 setAttribute( "value", value ); 155 } 156 157 158 163 public HTMLButtonElementImpl( HTMLDocumentImpl owner, String name ) 164 { 165 super( owner, name ); 166 } 167 168 169 } 170 171 | Popular Tags |