KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > components > OddjobDC


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

4 package org.oddjob.designer.components;
5
6 import org.oddjob.designer.elements.FilesDE;
7 import org.oddjob.designer.elements.ListDE;
8 import org.oddjob.designer.elements.MapDE;
9 import org.oddjob.designer.elements.SimpleDE;
10 import org.oddjob.designer.factory.DesignFactory;
11 import org.oddjob.designer.model.ElementField;
12 import org.oddjob.designer.model.FieldGroup;
13 import org.oddjob.designer.model.FileSelection;
14 import org.oddjob.designer.model.FormDefinition;
15 import org.oddjob.designer.model.MultiTypeTable;
16 import org.oddjob.designer.model.StandardForm;
17
18 /**
19  *
20  */

21 public class OddjobDC extends BaseDC {
22
23     private SimpleDE file = new SimpleDE();
24     private ListDE args = new ListDE();
25     private ListDE persister;
26     private ListDE classpath;
27     private SimpleDE loadOnly = new SimpleDE();
28     private SimpleDE substitution = new SimpleDE();
29     private MapDE componentType = new MapDE();
30     private MapDE valueType = new MapDE();
31     private MapDE propertyProxy = new MapDE();
32     
33     public OddjobDC() {
34         setPersister(new ListDE());
35         setClasspath(new ListDE());
36     }
37     
38     public FormDefinition form() {
39         return new StandardForm(tag())
40             .addGroup(basePanel())
41             .addGroup(new FieldGroup("Configuration Details")
42                     .add(new FileSelection("Configuration File", file))
43                     .add(new ElementField("Arguments", args))
44                     .add(new ElementField("Classpath", classpath))
45                     )
46             .addGroup(new FieldGroup("Advanced")
47                     .add(new ElementField("Persister", persister))
48                     .add(new ElementField("Substitution", substitution))
49                     .add(new ElementField("Load Only", loadOnly))
50                     )
51             .addGroup(new FieldGroup("User Defined")
52                     .add(new MultiTypeTable("Component Type", componentType)
53                             .setNamed(true).setVisibleRows(3))
54                     .add(new MultiTypeTable("Value Type", valueType)
55                             .setNamed(true).setVisibleRows(3))
56                     .add(new MultiTypeTable("Property Proxy", propertyProxy)
57                             .setNamed(true).setVisibleRows(3))
58                     );
59     }
60             
61     public void setFile(SimpleDE config) {
62         this.file = config;
63     }
64     
65     public SimpleDE getFile() {
66         return file;
67     }
68             
69     /**
70      * @return Returns the classpath.
71      */

72     public ListDE getClasspath() {
73         return classpath;
74     }
75     /**
76      * @param classpath The classpath to set.
77      */

78     public void setClasspath(ListDE classpath) {
79         classpath.supportedTypes(DesignFactory.supportedTypes(FilesDE.class));
80         this.classpath = classpath;
81     }
82     /**
83      * @return Returns the loadOnly.
84      */

85     public SimpleDE getLoadOnly() {
86         return loadOnly;
87     }
88     /**
89      * @param loadOnly The loadOnly to set.
90      */

91     public void setLoadOnly(SimpleDE loadOnly) {
92         this.loadOnly = loadOnly;
93     }
94     
95     public ListDE getPersister() {
96         return persister;
97     }
98     
99     public void setPersister(ListDE persister) {
100         persister.supportedTypes(new String JavaDoc[] { "filePersister", "sqlPersister" });
101         this.persister = persister;
102     }
103     
104     /**
105      * @return Returns the substitution.
106      */

107     public SimpleDE getSubstitution() {
108         return substitution;
109     }
110     /**
111      * @param substitution The substitution to set.
112      */

113     public void setSubstitution(SimpleDE substitution) {
114         this.substitution = substitution;
115     }
116     
117     /**
118      * @return Returns the componentType.
119      */

120     public MapDE getComponentType() {
121         return componentType;
122     }
123     /**
124      * @param componentType The componentType to set.
125      */

126     public void setComponentType(MapDE componentType) {
127         this.componentType = componentType;
128     }
129     /**
130      * @return Returns the propertyProxy.
131      */

132     public MapDE getPropertyProxy() {
133         return propertyProxy;
134     }
135     /**
136      * @param propertyProxy The propertyProxy to set.
137      */

138     public void setPropertyProxy(MapDE propertyProxy) {
139         this.propertyProxy = propertyProxy;
140     }
141     /**
142      * @return Returns the valueType.
143      */

144     public MapDE getValueType() {
145         return valueType;
146     }
147     /**
148      * @param valueType The valueType to set.
149      */

150     public void setValueType(MapDE valueType) {
151         this.valueType = valueType;
152     }
153
154     public ListDE getArgs() {
155         return args;
156     }
157
158     public void setArgs(ListDE args) {
159         this.args = args;
160     }
161 }
162
Popular Tags