KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* Deadlines.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>Deadline</b> instances.
22 */

23 public class Deadlines extends XMLCollection {
24    /**
25    * Creates a new instance of the class.
26    *
27    * @param act The activity that holds elements this element.
28    */

29    public Deadlines (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       Deadline d=new Deadline();
42       d.setRequired(true);
43       return d;
44    }
45
46    /**
47    * Creates panel which allows user to manipulate with instances
48    * of classes that makes a collection that this class represents.
49    * The panel consists of two sections: XMLListPanel - shows
50    * collections' elements, and XMLListControlPanel - display buttons
51    * for manipulating with that elements.
52    * <p>NOTE: The order of creation is relevant, first, the controlled
53    * panel must be created, and then the control panel
54    *
55    * @return DTDPanel to be shown
56    */

57    public XMLPanel getPanel () {
58       controlledPanel=new XMLListPanel(this,"",false,true,false);
59       controlPanel=new XMLListControlPanel(this,"",true,false,true);
60       return new XMLGroupPanel(this,new XMLPanel[]{
61          controlledPanel,controlPanel},toLabel(),XMLPanel.BOX_LAYOUT,
62          false,true);
63    }
64
65    /**
66    * Overrides super-class method to realize this class specific
67    * writting to XML file.
68    * <p>NOTE: This element doesn't exist in WfMC DTD and it is
69    * among other things, also introduced to gather Deadline
70    * definitions and write it int XML.
71    */

72    public void toXML (Node parent) throws DOMException {
73       if (refCollectionElements.size()>0) {
74          for (Iterator it=refCollectionElements.iterator(); it.hasNext();) {
75             ((XMLElement)it.next()).toXML(parent);
76          }
77       }
78    }
79
80    /*public int[] getInvisibleTableFieldOrdinals () {
81       int[] itfo=new int[4];
82       itfo[0]=0;
83       itfo[1]=3;
84       itfo[2]=4;
85       itfo[3]=5;
86       return itfo;
87    }*/

88
89    /**
90    * Used to create exact copy of instance of this class.
91    * The newly created instance will have all the properties
92    * same as the copied one.
93    *
94    * @return The newly created instance of this class.
95    */

96    public Object JavaDoc clone () {
97       Deadlines d=(Deadlines)super.clone();
98       return d;
99    }
100
101    /**
102    * Decrements an ID. Used when the temporary element is created. This
103    * avoids unnecessary incrementation of IDs.
104    */

105    protected void decrementID () {
106       super.decrementID();
107    }
108
109 }
110
Popular Tags