KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* ListType.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 /**
17 * Represents a WfMC DTD element that has the similar name.
18 *
19 * @see XML
20 */

21 public class ListType extends XMLComplexElement {
22    private DataTypes refType;
23
24    private DataTypes myOwner;
25    /**
26    * Creates a new instance of the class.
27    */

28    public ListType (DataTypes dtc,Package JavaDoc p) {
29       super();
30
31       myOwner=dtc;
32       refType=new DataTypes(this,p,null,0);
33       refType.setLabelName(XMLUtil.getLanguageDependentString("SubTypeKey"));
34       fillStructure();
35    }
36
37
38    public DataTypes getOwner () {
39       return myOwner;
40    }
41    /**
42    * Defines the super-class method. Read the explanation for
43    * this method within XMLComplexElement class.
44    */

45    protected void fillStructure () {
46       refType.setRequired(true);
47       complexStructure.add(refType);
48    }
49
50    /**
51    * Returns the value of choosen type.
52    *
53    * @return The value of choosen list type.
54    */

55    public Object JavaDoc toValue () {
56       return refType.toValue();
57    }
58
59    /**
60    * Prepares the panel with a combo box to choose the one of
61    * allowed list types.
62    *
63    * @return XMLPanel to be shown.
64    */

65    public XMLPanel getPanel () {
66       return refType.getPanel();
67    }
68
69    public void refreshLabelName () {
70       super.refreshLabelName();
71       refType.setLabelName(XMLUtil.getLanguageDependentString("SubTypeKey"));
72    }
73
74 }
75
Popular Tags