KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* Join.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 import org.w3c.dom.*;
16
17 /**
18 * Represents a WfMC DTD element that has the similar name.
19 */

20 public class Join extends XMLComplexElement {
21
22    public XMLAttribute attrType=new XMLAttribute("Type",
23       new String JavaDoc[] {
24          "",
25          "AND",
26          "XOR"
27       },0);
28
29    /**
30    * Creates a new instance of the class.
31    */

32    public Join () {
33       super();
34
35       attrType.setLabelName(XMLUtil.getLanguageDependentString("JoinTypeKey"));
36
37       fillStructure();
38    }
39
40    /**
41    * Defines the super-class method. Read the explanation for
42    * this method within XMLComplexElement class.
43    */

44    protected void fillStructure () {
45       attributes.add(attrType);
46       complexStructure.add(attrType);
47    }
48
49    /**
50    * The join is empty if user didn't select AND or XOR.
51    */

52    public boolean isEmpty() {
53       return (attrType.getChoosen().toString().length()==0);
54    }
55
56
57    /**
58    * Prepares the panel with a combo box to choose the one of
59    * allowed join types.
60    *
61    * @return XMLPanel to be shown.
62    */

63    public XMLPanel getPanel () {
64       return attrType.getPanel();
65    }
66
67
68 /* public XMLPanel getPanel () {
69       return new XMLGroupPanel(this,new Object[] {attrType.getPanel()},
70          XMLUtil.getResourceString("PreconditionKey"));
71    }*/

72
73    /**
74    * Used to create exact copy of instance of this class.
75    * The newly created instance will have all the properties
76    * same as the copied one.
77    *
78    * @return The newly created instance of this class.
79    */

80    public Object JavaDoc clone () {
81       Join j=(Join)super.clone();
82
83       j.attrType=(XMLAttribute)this.attrType.clone();
84       j.fillStructure();
85
86       return j;
87    }
88
89    public void refreshLabelName () {
90       super.refreshLabelName();
91       attrType.setLabelName(XMLUtil.getLanguageDependentString("JoinTypeKey"));
92    }
93
94 }
95
Popular Tags