1 57 package org.enhydra.xml.lazydom.html; 58 import org.enhydra.xml.lazydom.LazyElement; 59 import org.enhydra.xml.lazydom.LazyElementNoNS; 60 import org.w3c.dom.Node ; 61 import org.w3c.dom.NodeList ; 62 import org.w3c.dom.html.HTMLCollection; 63 import org.w3c.dom.html.HTMLFormElement; 64 65 66 72 public class HTMLFormElementImpl 73 extends LazyHTMLElement 74 implements HTMLFormElement 75 { 76 77 78 public HTMLCollection getElements() 79 { 80 if ( _elements == null ) 81 _elements = new HTMLCollectionImpl( this, HTMLCollectionImpl.ELEMENT ); 82 return _elements; 83 } 84 85 86 public int getLength() 87 { 88 return getElements().getLength(); 89 } 90 91 92 public String getName() 93 { 94 return getAttribute( "name" ); 95 } 96 97 98 public void setName( String name ) 99 { 100 setAttribute( "name", name ); 101 } 102 103 104 public String getAcceptCharset() 105 { 106 return getAttribute( "accept-charset" ); 107 } 108 109 110 public void setAcceptCharset( String acceptCharset ) 111 { 112 setAttribute( "accept-charset", acceptCharset ); 113 } 114 115 116 public String getAction() 117 { 118 return getAttribute( "action" ); 119 } 120 121 122 public void setAction( String action ) 123 { 124 setAttribute( "action", action ); 125 } 126 127 128 public String getEnctype() 129 { 130 return getAttribute( "enctype" ); 131 } 132 133 134 public void setEnctype( String enctype ) 135 { 136 setAttribute( "enctype", enctype ); 137 } 138 139 140 public String getMethod() 141 { 142 return capitalize( getAttribute( "method" ) ); 143 } 144 145 146 public void setMethod( String method ) 147 { 148 setAttribute( "method", method ); 149 } 150 151 152 public String getTarget() 153 { 154 return getAttribute( "target" ); 155 } 156 157 158 public void setTarget( String target ) 159 { 160 setAttribute( "target", target ); 161 } 162 163 164 public void submit() 165 { 166 } 168 169 170 public void reset() 171 { 172 } 174 175 179 public NodeList getChildNodes() { 180 if (!areChildrenExpanded()) { 181 expandChildren(); 182 } 183 184 return getChildNodesUnoptimized(); 185 } 186 187 191 public Node cloneNode( boolean deep ) { 192 HTMLFormElementImpl clonedNode = (HTMLFormElementImpl)super.cloneNode( deep ); 193 clonedNode._elements = null; 194 return clonedNode; 195 } 196 197 202 public HTMLFormElementImpl( LazyHTMLDocument owner, LazyElement template, String name ) 203 { 204 super( owner, template, name ); 205 } 206 207 208 211 private HTMLCollectionImpl _elements; 212 213 } 214 215 | Popular Tags |