KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* Tools.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 java.util.*;
17 import org.w3c.dom.*;
18
19 /**
20 * This is not a real WfMC DTD element, but it is introduced to help.
21 * This class is a collection of class <b>Tool</b> instances.
22 */

23 public class Tools extends XMLCollection {
24    /**
25    * Creates a new instance of the class.
26    *
27    * @param act The activity which owns this tools.
28    */

29    public Tools (Activity act){
30       super(act);
31    }
32
33    // min=0, max=unbounded
34
/**
35    * Generates a new element of the class which instances
36    * are members of collection of this class.
37    *
38    * return The generated instance of class that makes collection.
39    */

40    public XMLElement generateNewElement() {
41       Tool t=new Tool(this,((Activity)myOwner).getOwnerProcess());
42       t.setRequired(true);
43       return t;
44    }
45
46    /**
47    * Overrides super-class method to realize this class specific
48    * writting to XML file.
49    * <p>NOTE: This element doesn't exist in WfMC DTD and it is
50    * among other things, also introduced to gather Tool
51    * definitions and write it int XML.
52    *
53    * @return The string for a zero or more of Tool element tags.
54    */

55    public void toXML (Node parent) throws DOMException {
56       if (refCollectionElements.size()>0) {
57          for (Iterator it=refCollectionElements.iterator(); it.hasNext();) {
58             ((XMLElement)it.next()).toXML(parent);
59          }
60       }
61    }
62
63    /**
64    * Called after importing of XML file to set the contained tools properly.
65    */

66    protected void afterImporting () {
67       Iterator it=refCollectionElements.iterator();
68       while (it.hasNext()) {
69          Tool t=(Tool)it.next();
70          t.afterImporting();
71       }
72    }
73
74    public int[] getInvisibleTableFieldOrdinals () {
75       int[] itfo=new int[4];
76       itfo[0]=0;
77       itfo[1]=3;
78       itfo[2]=4;
79       itfo[3]=5;
80       return itfo;
81    }
82
83    /**
84    * Used to create exact copy of instance of this class.
85    * The newly created instance will have all the properties
86    * same as the copied one.
87    *
88    * @return The newly created instance of this class.
89    */

90    public Object JavaDoc clone () {
91       Tools t=(Tools)super.clone();
92       return t;
93    }
94
95 }
96
Popular Tags