KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* ExtendedAttributes.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
18 /**
19 * Represents a WfMC DTD element that has the similar name.
20 * This class is a collection of class <b>ExtendedAttribute</b> instances.
21 *
22 * @see XMLCollection
23 */

24 public class ExtendedAttributes extends XMLCollection {
25    /**
26    * Creates a new instance of the class.
27    *
28    * @param myOwner Could be any class derived from XMLComplexElement
29    * class (e.g. Activity, Transition, Package, ...).
30    */

31    public ExtendedAttributes (XMLComplexElement myOwner) {
32       super(myOwner,"ExtendedAttributes");
33    }
34
35    /**
36    * Generates a new element of the class which instances
37    * are members of collection of this class.
38    *
39    * return The generated instance of class that makes collection.
40    */

41    public XMLElement generateNewElement() {
42       ExtendedAttribute ea=new ExtendedAttribute(this);
43       ea.setRequired(true);
44       return ea;
45    }
46
47    public ExtendedAttribute getExtendedAttribute (String JavaDoc name) {
48       return (ExtendedAttribute)super.getCollectionElement(name);
49    }
50
51    /**
52    * Used to create exact copy of instance of this class.
53    * The newly created instance will have all the properties
54    * same as the copied one.
55    *
56    * @return The newly created instance of this class.
57    */

58    public Object JavaDoc clone () {
59       ExtendedAttributes eas=(ExtendedAttributes)super.clone();
60       eas.myOwner=this.myOwner;
61       return eas;
62    }
63
64    public int[] getInvisibleTableFieldOrdinals () {
65       int[] itfo=new int[2];
66       itfo[0]=2;
67       itfo[1]=3;
68       return itfo;
69    }
70
71    // First, the controlled panel must be created, and then the control panel
72
public XMLPanel getPanel () {
73       controlledPanel=new XMLTablePanel(this,"",false,false,true);
74       controlPanel=new XMLTableControlPanel(this,"",true,false);
75       return new XMLGroupPanel(this,new XMLPanel[]{
76          controlledPanel,controlPanel},toLabel(),XMLPanel.BOX_LAYOUT,
77          false,true);
78    }
79
80 }
81
Popular Tags