KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xhtml > dom > xerces > XHTMLTableSectionElementImpl


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Original Code is DigitalSesame
15  * Portions created by DigitalSesame are Copyright (C) 1997-2000 DigitalSesame
16  * All Rights Reserved.
17  *
18  * Contributor(s):
19  * Rex Tsai <chihchun@digitalsesame.com>
20  * David Li <david@digitalsesam.com>
21  *
22  * $Id: XHTMLTableSectionElementImpl.java,v 1.2 2005/01/26 08:29:24 jkjome Exp $
23  */

24
25 package org.enhydra.xml.xhtml.dom.xerces;
26
27 import org.w3c.dom.Node JavaDoc;
28 import org.w3c.dom.html.HTMLCollection;
29 import org.w3c.dom.html.HTMLElement;
30 import org.w3c.dom.html.HTMLTableRowElement;
31
32 public class XHTMLTableSectionElementImpl
33     extends XHTMLElementImpl
34     implements org.enhydra.xml.xhtml.dom.XHTMLTableSectionElement
35 {
36
37     public XHTMLTableSectionElementImpl (XHTMLDocumentBase owner, String JavaDoc namespaceURI, String JavaDoc tagName) {
38     super( owner, namespaceURI, tagName);
39     }
40
41         public void setId (String JavaDoc newValue) {
42     setAttribute("id", newValue);
43     }
44
45     public String JavaDoc getId () {
46     return getAttribute ("id");
47     }
48     public void setLang (String JavaDoc newValue) {
49     setAttribute("lang", newValue);
50     }
51
52     public String JavaDoc getLang () {
53     return getAttribute ("lang");
54     }
55     public void setDir (String JavaDoc newValue) {
56     setAttribute("dir", newValue);
57     }
58
59     public String JavaDoc getDir () {
60     return getAttribute ("dir");
61     }
62     public void setClassName (String JavaDoc newValue) {
63     setAttribute("class", newValue);
64     }
65
66     public String JavaDoc getClassName () {
67     return getAttribute ("class");
68     }
69     public void setTitle (String JavaDoc newValue) {
70     setAttribute("title", newValue);
71     }
72
73     public String JavaDoc getTitle () {
74     return getAttribute ("title");
75     }
76     public void setAlign (String JavaDoc newValue) {
77     setAttribute("align", newValue);
78     }
79
80     public String JavaDoc getAlign () {
81     return getAttribute ("align");
82     }
83
84     public void setVAlign (String JavaDoc newValue) {
85     setAttribute("valign", newValue);
86     }
87
88     public String JavaDoc getVAlign () {
89     return getAttribute ("valign");
90     }
91     public void setOnKeyUp (String JavaDoc newValue) {
92     setAttribute("onkeyup", newValue);
93     }
94
95     public String JavaDoc getOnKeyUp () {
96     return getAttribute ("onkeyup");
97     }
98     public void setStyle (String JavaDoc newValue) {
99     setAttribute("style", newValue);
100     }
101
102     public String JavaDoc getStyle () {
103     return getAttribute ("style");
104     }
105     public void setOnMouseDown (String JavaDoc newValue) {
106     setAttribute("onmousedown", newValue);
107     }
108
109     public String JavaDoc getOnMouseDown () {
110     return getAttribute ("onmousedown");
111     }
112     public void setOnKeyPress (String JavaDoc newValue) {
113     setAttribute("onkeypress", newValue);
114     }
115
116     public String JavaDoc getOnKeyPress () {
117     return getAttribute ("onkeypress");
118     }
119     public void setOnDblClick (String JavaDoc newValue) {
120     setAttribute("ondblclick", newValue);
121     }
122
123     public String JavaDoc getOnDblClick () {
124     return getAttribute ("ondblclick");
125     }
126     public void setOnKeyDown (String JavaDoc newValue) {
127     setAttribute("onkeydown", newValue);
128     }
129
130     public String JavaDoc getOnKeyDown () {
131     return getAttribute ("onkeydown");
132     }
133     public void setOnMouseMove (String JavaDoc newValue) {
134     setAttribute("onmousemove", newValue);
135     }
136
137     public String JavaDoc getOnMouseMove () {
138     return getAttribute ("onmousemove");
139     }
140     public void setOnMouseUp (String JavaDoc newValue) {
141     setAttribute("onmouseup", newValue);
142     }
143
144     public String JavaDoc getOnMouseUp () {
145     return getAttribute ("onmouseup");
146     }
147     public void setXmlLang (String JavaDoc newValue) {
148     setAttribute("xml:lang", newValue);
149     }
150
151     public String JavaDoc getXmlLang () {
152     return getAttribute ("xml:lang");
153     }
154     public void setOnMouseOut (String JavaDoc newValue) {
155     setAttribute("onmouseout", newValue);
156     }
157
158     public String JavaDoc getOnMouseOut () {
159     return getAttribute ("onmouseout");
160     }
161     public void setOnClick (String JavaDoc newValue) {
162     setAttribute("onclick", newValue);
163     }
164
165     public String JavaDoc getOnClick () {
166     return getAttribute ("onclick");
167     }
168     public void setOnMouseOver (String JavaDoc newValue) {
169     setAttribute("onmouseover", newValue);
170     }
171
172     public String JavaDoc getOnMouseOver () {
173     return getAttribute ("onmouseover");
174     }
175     public void setChOff (String JavaDoc newValue) {
176     setAttribute("charoff", newValue);
177     }
178
179     public String JavaDoc getChOff () {
180     return getAttribute ("charoff");
181     }
182
183     public String JavaDoc getCh() {
184         String JavaDoc ch;
185         
186         // Make sure that the access key is a single character.
187
ch = getAttribute( "char" );
188         if ( ch != null && ch.length() > 1 )
189             ch = ch.substring( 0, 1 );
190         return ch;
191     }
192     
193     
194     public void setCh( String JavaDoc ch ) {
195         // Make sure that the access key is a single character.
196
if ( ch != null && ch.length() > 1 )
197             ch = ch.substring( 0, 1 );
198         setAttribute( "char", ch );
199     }
200     
201     public HTMLCollection getRows() {
202         if ( _rows == null )
203             _rows = new XHTMLCollectionImpl( this, XHTMLCollectionImpl.ROW );
204         return _rows;
205     }
206     
207     
208     public HTMLElement insertRow( int index ) {
209         XHTMLTableRowElementImpl newRow;
210         
211         newRow = new XHTMLTableRowElementImpl( (XHTMLDocumentBase) getOwnerDocument(), getNamespaceURI(), "TR" );
212         newRow.insertCell( 0 );
213         if ( insertRowX( index, newRow ) >= 0 )
214             appendChild( newRow );
215         return newRow;
216     }
217     
218     
219     int insertRowX( int index, XHTMLTableRowElementImpl newRow ) {
220         Node JavaDoc child;
221         
222         child = getFirstChild();
223         while ( child != null ) {
224             if ( child instanceof HTMLTableRowElement ) {
225                 if ( index == 0 ) {
226                     insertBefore( newRow, child );
227                     return -1;
228                 }
229                 --index;
230             }
231             child = child.getNextSibling();
232         }
233         return index;
234     }
235
236     
237     public void deleteRow( int index ) {
238         deleteRowX( index );
239     }
240
241     
242     int deleteRowX( int index ) {
243         Node JavaDoc child;
244         
245         child = getFirstChild();
246         while ( child != null ) {
247             if ( child instanceof HTMLTableRowElement ) {
248                 if ( index == 0 ) {
249                     removeChild ( child );
250                     return -1;
251                 }
252                 --index;
253             }
254             child = child.getNextSibling();
255         }
256         return index;
257     }
258
259     private XHTMLCollectionImpl _rows;
260
261
262
263 ;
264 }
265
266
267
Popular Tags