KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* ParticipantType.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 ParticipantType extends XMLComplexElement {
22    // required
23
private XMLAttribute attrType=new XMLAttribute("Type",
24       new String JavaDoc[] {
25          "RESOURCE_SET",
26          "RESOURCE",
27          "ROLE",
28          "ORGANIZATIONAL_UNIT",
29          "HUMAN",
30          "SYSTEM"
31       },
32       2,false,true);
33
34    /**
35    * Creates a new instance of the class.
36    *
37    */

38    public ParticipantType () {
39       super();
40
41       fillStructure();
42    }
43
44    /**
45    * Defines the super-class method. Read the explanation for
46    * this method within XMLComplexElement class.
47    */

48    protected void fillStructure () {
49       attrType.setRequired(true);
50       complexStructure.add(attrType);
51       attributes.add(attrType);
52    }
53
54    /**
55    * Prepares the panel with a radio buttons to choose the one of
56    * allowed participant types.
57    *
58    * @return XMLPanel to be shown.
59    */

60    public XMLPanel getPanel () {
61       return attrType.getPanel();
62    }
63
64    /**
65    * Returns the value of choosen type. The value is not the
66    * text displayed in combo box (this is a language dependent
67    * representation of value), but the text defined in WfMC DTD
68    * for this element "Type" attribute.
69    *
70    * @return The value of choosen type.
71    */

72    public Object JavaDoc toValue () {
73       return attrType.toValue();
74    }
75
76    /**
77    * Overrides super-class method to retreive the choosen
78    * type of participant.
79    * This is used when displaying instance of this class
80    * within @see XMLTreePanel.
81    *
82    * @return The type of participant.
83    */

84    public String JavaDoc toString () {
85       return attrType.toString();
86    }
87
88 }
89
Popular Tags