KickJava   Java API By Example, From Geeks To Geeks.

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


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

4 package org.oddjob.designer.model;
5
6 import java.util.ArrayList JavaDoc;
7 import java.util.List JavaDoc;
8
9 /**
10  * A form definition provides a definition for creating the
11  * designer detail panel.
12  */

13 public class StandardForm implements FormDefinition {
14
15     private final String JavaDoc name;
16     private List JavaDoc groups = new ArrayList JavaDoc();
17     
18     public StandardForm(String JavaDoc name) {
19         this.name = name;
20     }
21     
22     public String JavaDoc getName() {
23         return name;
24     }
25     
26     /**
27      * Add a dialog definition which will be rendered as a group on the form.
28      *
29      * @param designDef A design definition.
30      * @return This form definition.
31      */

32     public StandardForm addGroup(DesignDefinition designDef) {
33         groups.add(designDef);
34         return this;
35     }
36     
37     public int size() {
38         return groups.size();
39     }
40         
41     public DesignDefinition getDesignDefinition(int index) {
42         return (DesignDefinition) groups.get(index);
43     }
44     
45 }
46
Popular Tags