KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > view > MultiTypeTreeDummy


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

4 package org.oddjob.designer.view;
5
6 import org.oddjob.designer.model.DesignDefinition;
7 import org.oddjob.designer.model.DesignElementType;
8 import org.oddjob.designer.model.MultiTypeTree;
9
10 public class MultiTypeTreeDummy extends DummyView {
11
12     private MultiTypeTree multiTypeTree;
13     
14     public MultiTypeTreeDummy(MultiTypeTree multiTypeTree) {
15         this.multiTypeTree = multiTypeTree;
16         DesignElementType de = (DesignElementType) multiTypeTree.getDesignElement();
17         DesignElementType[] children = de.children();
18         for (int i = 0; i < children.length; ++i) {
19             DesignDefinition designDefinition = children[i].detail();
20             inline(designDefinition);
21         }
22     }
23     
24     public DummyView create(String JavaDoc type) {
25         DesignElementType det = multiTypeTree.getDesignElement();
26         DesignElementType child = det.createType(type);
27         det.addChild(child);
28         return inline(child.detail());
29     }
30 }
31
Popular Tags