01: package discRack.presentation.delements;
02:
03: import discRack.presentation.dpanels.DPanel;
04:
05: import java.util.*;
06:
07: /**
08: * Represents the collection element - thus means that it has simple element
09: * 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 name, DCollection myCollection) {
22: super (name);
23:
24: this .myCollection = myCollection;
25: }
26:
27: public String 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: }
|