1 20 21 22 package org.ozoneDB.xml.dom.html; 23 24 25 import org.ozoneDB.xml.dom.ElementImpl; 26 import org.w3c.dom.Node ; 27 import org.w3c.dom.Text ; 28 import org.w3c.dom.html.HTMLScriptElement; 29 30 31 37 public final class HTMLScriptElementImpl extends HTMLElementImpl implements HTMLScriptElement { 38 39 40 public String getText() { 41 Node child; 42 String text; 43 44 child = getFirstChild(); 47 text = ""; 48 while (child != null) { 49 if (child instanceof Text ) { 50 text = text + ((Text )child).getData(); 51 } 52 child = child.getNextSibling(); 53 } 54 return text; 55 } 56 57 58 public void setText( String text ) { 59 Node child; 60 Node next; 61 62 child = getFirstChild(); 65 while (child != null) { 66 next = child.getNextSibling(); 67 removeChild( child ); 68 child = next; 69 } 70 insertBefore( getOwnerDocument().createTextNode( text ), getFirstChild() ); 71 } 72 73 74 public String getHtmlFor() { 75 return getAttribute( "for" ); 76 } 77 78 79 public void setHtmlFor( String htmlFor ) { 80 setAttribute( "for", htmlFor ); 81 } 82 83 84 public String getEvent() { 85 return getAttribute( "event" ); 86 } 87 88 89 public void setEvent( String event ) { 90 setAttribute( "event", event ); 91 } 92 93 94 public String getCharset() { 95 return getAttribute( "charset" ); 96 } 97 98 99 public void setCharset( String charset ) { 100 setAttribute( "charset", charset ); 101 } 102 103 104 public boolean getDefer() { 105 return getAttribute( "defer" ) != null; 106 } 107 108 109 public void setDefer( boolean defer ) { 110 setAttribute( "defer", defer ? "" : null ); 111 } 112 113 114 public String getSrc() { 115 return getAttribute( "src" ); 116 } 117 118 119 public void setSrc( String src ) { 120 setAttribute( "src", src ); 121 } 122 123 124 public String getType() { 125 return getAttribute( "type" ); 126 } 127 128 129 public void setType( String type ) { 130 setAttribute( "type", type ); 131 } 132 133 134 139 public HTMLScriptElementImpl( HTMLDocumentImpl owner, String name ) { 140 super( owner, "SCRIPT" ); 141 } 142 143 144 } 145 | Popular Tags |