KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > model > MultiTypeTree


1 /*
2  * (c) Rob Gordon 2005
3  */

4 package org.oddjob.designer.model;
5
6 import org.oddjob.designer.arooa.DesignIH;
7
8 /**
9  * This class is the model for a DesignElement which has
10  * a hierarchy of child DesignElements.
11  */

12 public class MultiTypeTree implements DesignDefinition {
13
14     private final String JavaDoc heading;
15     private final DesignElementType designElement;
16     
17     /** What is the detail of the top level element in the tree */
18     private DesignDefinition detail;
19     
20     public MultiTypeTree(String JavaDoc heading, DesignElementType de) {
21         this.heading = heading;
22         this.designElement = de;
23         
24     }
25
26     public MultiTypeTree setDetail(DesignDefinition detail) {
27         this.detail = detail;
28         return this;
29     }
30     
31     public DesignDefinition getDetail() {
32         return detail;
33     }
34     
35     public String JavaDoc getTitle() {
36         return heading;
37     }
38
39     public DesignElementType getDesignElement() {
40         return designElement;
41     }
42     
43     /* (non-Javadoc)
44      * @see org.oddjob.designer.model.DialogDefinition#accept(org.oddjob.designer.model.DialogProcessor)
45      */

46     public void accept(DesignProcessor processor) {
47         processor.onMulipleTypeTree(this);
48     }
49     
50     /* (non-Javadoc)
51      * @see org.oddjob.designer.model.DesignDefinition#isPopulated()
52      */

53     public boolean isPopulated() {
54         DesignIH dih = DesignIH.getHelper(designElement.getClass());
55         return dih.hasDetailData(designElement);
56     }
57 }
58
Popular Tags