1 24 25 package org.enhydra.xml.xhtml.dom.xerces; 26 27 import org.w3c.dom.Node ; 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 namespaceURI, String tagName) { 38 super( owner, namespaceURI, tagName); 39 } 40 41 public void setId (String newValue) { 42 setAttribute("id", newValue); 43 } 44 45 public String getId () { 46 return getAttribute ("id"); 47 } 48 public void setLang (String newValue) { 49 setAttribute("lang", newValue); 50 } 51 52 public String getLang () { 53 return getAttribute ("lang"); 54 } 55 public void setDir (String newValue) { 56 setAttribute("dir", newValue); 57 } 58 59 public String getDir () { 60 return getAttribute ("dir"); 61 } 62 public void setClassName (String newValue) { 63 setAttribute("class", newValue); 64 } 65 66 public String getClassName () { 67 return getAttribute ("class"); 68 } 69 public void setTitle (String newValue) { 70 setAttribute("title", newValue); 71 } 72 73 public String getTitle () { 74 return getAttribute ("title"); 75 } 76 public void setAlign (String newValue) { 77 setAttribute("align", newValue); 78 } 79 80 public String getAlign () { 81 return getAttribute ("align"); 82 } 83 84 public void setVAlign (String newValue) { 85 setAttribute("valign", newValue); 86 } 87 88 public String getVAlign () { 89 return getAttribute ("valign"); 90 } 91 public void setOnKeyUp (String newValue) { 92 setAttribute("onkeyup", newValue); 93 } 94 95 public String getOnKeyUp () { 96 return getAttribute ("onkeyup"); 97 } 98 public void setStyle (String newValue) { 99 setAttribute("style", newValue); 100 } 101 102 public String getStyle () { 103 return getAttribute ("style"); 104 } 105 public void setOnMouseDown (String newValue) { 106 setAttribute("onmousedown", newValue); 107 } 108 109 public String getOnMouseDown () { 110 return getAttribute ("onmousedown"); 111 } 112 public void setOnKeyPress (String newValue) { 113 setAttribute("onkeypress", newValue); 114 } 115 116 public String getOnKeyPress () { 117 return getAttribute ("onkeypress"); 118 } 119 public void setOnDblClick (String newValue) { 120 setAttribute("ondblclick", newValue); 121 } 122 123 public String getOnDblClick () { 124 return getAttribute ("ondblclick"); 125 } 126 public void setOnKeyDown (String newValue) { 127 setAttribute("onkeydown", newValue); 128 } 129 130 public String getOnKeyDown () { 131 return getAttribute ("onkeydown"); 132 } 133 public void setOnMouseMove (String newValue) { 134 setAttribute("onmousemove", newValue); 135 } 136 137 public String getOnMouseMove () { 138 return getAttribute ("onmousemove"); 139 } 140 public void setOnMouseUp (String newValue) { 141 setAttribute("onmouseup", newValue); 142 } 143 144 public String getOnMouseUp () { 145 return getAttribute ("onmouseup"); 146 } 147 public void setXmlLang (String newValue) { 148 setAttribute("xml:lang", newValue); 149 } 150 151 public String getXmlLang () { 152 return getAttribute ("xml:lang"); 153 } 154 public void setOnMouseOut (String newValue) { 155 setAttribute("onmouseout", newValue); 156 } 157 158 public String getOnMouseOut () { 159 return getAttribute ("onmouseout"); 160 } 161 public void setOnClick (String newValue) { 162 setAttribute("onclick", newValue); 163 } 164 165 public String getOnClick () { 166 return getAttribute ("onclick"); 167 } 168 public void setOnMouseOver (String newValue) { 169 setAttribute("onmouseover", newValue); 170 } 171 172 public String getOnMouseOver () { 173 return getAttribute ("onmouseover"); 174 } 175 public void setChOff (String newValue) { 176 setAttribute("charoff", newValue); 177 } 178 179 public String getChOff () { 180 return getAttribute ("charoff"); 181 } 182 183 public String getCh() { 184 String ch; 185 186 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 ch ) { 195 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 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 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 |