KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > html > dom > HTMLButtonElementImpl


1 /*
2  * Copyright 1999,2000,2004,2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.html.dom;
17
18 import org.w3c.dom.html.HTMLButtonElement;
19
20 /**
21  * @xerces.internal
22  * @version $Revision: 1.9 $ $Date: 2005/04/18 00:41:07 $
23  * @author <a HREF="mailto:arkin@exoffice.com">Assaf Arkin</a>
24  * @see org.w3c.dom.html.HTMLButtonElement
25  * @see org.apache.xerces.dom.ElementImpl
26  */

27 public class HTMLButtonElementImpl
28     extends HTMLElementImpl
29     implements HTMLButtonElement, HTMLFormControl
30 {
31
32     private static final long serialVersionUID = 3258131349495100728L;
33
34     public String JavaDoc getAccessKey()
35     {
36         String JavaDoc accessKey;
37         
38         // Make sure that the access key is a single character.
39
accessKey = getAttribute( "accesskey" );
40         if ( accessKey != null && accessKey.length() > 1 )
41             accessKey = accessKey.substring( 0, 1 );
42         return accessKey;
43     }
44     
45     
46     public void setAccessKey( String JavaDoc accessKey )
47     {
48         // Make sure that the access key is a single character.
49
if ( accessKey != null && accessKey.length() > 1 )
50             accessKey = accessKey.substring( 0, 1 );
51         setAttribute( "accesskey", accessKey );
52     }
53
54     
55     public boolean getDisabled()
56     {
57         return getBinary( "disabled" );
58     }
59     
60     
61     public void setDisabled( boolean disabled )
62     {
63         setAttribute( "disabled", disabled );
64     }
65
66
67     public String JavaDoc getName()
68     {
69         return getAttribute( "name" );
70     }
71     
72     
73     public void setName( String JavaDoc name )
74     {
75         setAttribute( "name", name );
76     }
77
78     
79     public int getTabIndex()
80     {
81         try
82         {
83             return Integer.parseInt( getAttribute( "tabindex" ) );
84         }
85         catch ( NumberFormatException JavaDoc except )
86         {
87             return 0;
88         }
89     }
90     
91     
92     public void setTabIndex( int tabIndex )
93     {
94         setAttribute( "tabindex", String.valueOf( tabIndex ) );
95     }
96
97     
98     public String JavaDoc getType()
99     {
100         return capitalize( getAttribute( "type" ) );
101     }
102
103     
104       public String JavaDoc getValue()
105     {
106         return getAttribute( "value" );
107     }
108     
109     
110     public void setValue( String JavaDoc value )
111     {
112         setAttribute( "value", value );
113     }
114     
115     
116     /**
117      * Constructor requires owner document.
118      *
119      * @param owner The owner HTML document
120      */

121     public HTMLButtonElementImpl( HTMLDocumentImpl owner, String JavaDoc name )
122     {
123         super( owner, name );
124     }
125   
126   
127 }
128
129
Popular Tags