KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > xml > elements > Description


1 /* Description.java
2  *
3  * Authors:
4  * Stefanovic Nenad chupo@iis.ns.ac.yu
5  * Bojanic Sasa sasaboy@neobee.net
6  * Puskas Vladimir vpuskas@eunet.yu
7  * Pilipovic Goran zboniek@uns.ac.yu
8  *
9  */

10
11 package org.enhydra.jawe.xml.elements;
12
13 import org.enhydra.jawe.xml.*;
14 import org.enhydra.jawe.xml.panels.*;
15
16 import org.w3c.dom.*;
17 import javax.swing.tree.*;
18
19 /**
20 * Represents a WfMC DTD element that has the similar name.
21 *
22 * @see XML
23 */

24 public class Description extends XMLSimpleElement {
25    /**
26    * Prepares the panel for entering/reading description of
27    * some XML element. This panel alowes entering of multiple
28    * lines of text.
29    *
30    * @return XMLPanel to be shown.
31    */

32    public XMLPanel getPanel () {
33       return new XMLMultiLineTextPanel(this);
34    }
35
36    public DefaultMutableTreeNode getNode() {
37       return new ToNameMutableTreeNode( this ) {
38          public String JavaDoc toString() {
39             if ( this.userObject == null )
40                return null;
41             String JavaDoc name = ( ( XMLElement ) userObject ).toName();
42             return name;
43          }
44       };
45    }
46
47
48 /*
49    public void toXML(Node parent) throws DOMException {
50       //System.out.println("Element="+name);
51       if (!isEmpty()) {
52          Node node = (parent.getOwnerDocument()).createElement(name);
53          TextImpl timpl=(TextImpl)parent.getOwnerDocument().createTextNode(toString().trim());
54          timpl.setIgnorableWhitespace(true);
55          node.appendChild(timpl);
56          parent.appendChild(node);
57 //System.out.println("IIWS"+timpl.isIgnorableWhitespace());
58       }
59       return "";
60    }
61 */

62
63 }
64
Popular Tags