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