KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > xml > dom > html > HTMLLabelElementImpl


1 /**
2  * org/ozone-db/xml/dom/html/HTMLLabelElementImpl.java
3  *
4  * The contents of this file are subject to the OpenXML Public
5  * License Version 1.0; you may not use this file except in compliance
6  * with the License. You may obtain a copy of the License at
7  * http://www.openxml.org/license.html
8  *
9  * THIS SOFTWARE IS DISTRIBUTED ON AN "AS IS" BASIS WITHOUT WARRANTY
10  * OF ANY KIND, EITHER EXPRESSED OR IMPLIED. THE INITIAL DEVELOPER
11  * AND ALL CONTRIBUTORS SHALL NOT BE LIABLE FOR ANY DAMAGES AS A
12  * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
13  * DERIVATIVES. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING
14  * RIGHTS AND LIMITATIONS UNDER THE LICENSE.
15  *
16  * The Initial Developer of this code under the License is Assaf Arkin.
17  * Portions created by Assaf Arkin are Copyright (C) 1998, 1999.
18  * All Rights Reserved.
19  */

20
21
22 package org.ozoneDB.xml.dom.html;
23
24
25 import org.ozoneDB.xml.dom.ElementImpl;
26 import org.w3c.dom.html.HTMLLabelElement;
27
28
29 /**
30  * @version $Revision: 1.2 $ $Date: 2003/11/20 23:18:42 $
31  * @author <a HREF="mailto:arkin@trendline.co.il">Assaf Arkin</a>
32  * @see org.w3c.dom.html.HTMLLabelElement
33  * @see ElementImpl
34  */

35 public final class HTMLLabelElementImpl extends HTMLElementImpl implements HTMLLabelElement, HTMLFormControl {
36
37
38     public String JavaDoc getAccessKey() {
39         String JavaDoc accessKey;
40
41         // Make sure that the access key is a single character.
42
accessKey = getAttribute( "accesskey" );
43         if (accessKey != null && accessKey.length() > 1) {
44             accessKey = accessKey.substring( 0, 1 );
45         }
46         return accessKey;
47     }
48
49
50     public void setAccessKey( String JavaDoc accessKey ) {
51         // Make sure that the access key is a single character.
52
if (accessKey != null && accessKey.length() > 1) {
53             accessKey = accessKey.substring( 0, 1 );
54         }
55         setAttribute( "accesskey", accessKey );
56     }
57
58
59     public String JavaDoc getHtmlFor() {
60         return getAttribute( "for" );
61     }
62
63
64     public void setHtmlFor( String JavaDoc htmlFor ) {
65         setAttribute( "for", htmlFor );
66     }
67
68
69     /**
70      * Constructor requires owner document.
71      *
72      * @param owner The owner HTML document
73      */

74     public HTMLLabelElementImpl( HTMLDocumentImpl owner, String JavaDoc name ) {
75         super( owner, "LABEL" );
76     }
77
78
79 }
80
Popular Tags