KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > discRack > presentation > delements > DCollectionElement


1 package discRack.presentation.delements;
2
3 import discRack.presentation.dpanels.DPanel;
4
5 import java.util.*;
6
7 /**
8  * Represents the collection element - thus means that it has simple element
9  * with ID attribute.
10  *
11  * @author Sasa Bojanic
12  * @version 1.0
13  */

14 public class DCollectionElement extends DComplexElement {
15
16    protected DSimpleElement attrId=new DSimpleElement("Id"); //required
17
protected DCollection myCollection;
18
19    // element by itself doesn't fill the structure - it is up
20
// to extended classes to do it
21
public DCollectionElement (String JavaDoc name,DCollection myCollection) {
22       super(name);
23
24       this.myCollection=myCollection;
25    }
26
27    public String JavaDoc getID() {
28       return attrId.value.toString();
29    }
30
31    public DCollection getCollection () {
32       return myCollection;
33    }
34
35    protected void fillStructure () {
36       attrId.setRequired(true);
37       attrId.setReadOnly(true);
38
39       complexStructure.add(attrId);
40    }
41
42 }
Popular Tags