1 10 11 12 package org.enhydra.jawe.xml; 13 14 import org.enhydra.jawe.xml.panels.*; 15 16 import javax.swing.JPanel ; 17 import javax.swing.JComponent ; 18 import org.w3c.dom.*; 19 20 public class XMLSimpleElement extends XMLElement { 21 22 public XMLSimpleElement () { 23 super(); 24 } 25 26 public void toXML(Node parent) throws DOMException { 27 if (!isEmpty() || isRequired()) { 29 if (parent!=null) { 30 Node node = (parent.getOwnerDocument()).createElement(name); 31 node.appendChild(parent.getOwnerDocument().createTextNode(toString().trim())); 32 parent.appendChild(node); 33 } 34 } 35 } 36 37 public XMLPanel getPanel () { 38 return new XMLTextPanel(this); 39 } 40 41 } 42 43 44 | Popular Tags |