1 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 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 72 public ListDE getClasspath() { 73 return classpath; 74 } 75 78 public void setClasspath(ListDE classpath) { 79 classpath.supportedTypes(DesignFactory.supportedTypes(FilesDE.class)); 80 this.classpath = classpath; 81 } 82 85 public SimpleDE getLoadOnly() { 86 return loadOnly; 87 } 88 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 [] { "filePersister", "sqlPersister" }); 101 this.persister = persister; 102 } 103 104 107 public SimpleDE getSubstitution() { 108 return substitution; 109 } 110 113 public void setSubstitution(SimpleDE substitution) { 114 this.substitution = substitution; 115 } 116 117 120 public MapDE getComponentType() { 121 return componentType; 122 } 123 126 public void setComponentType(MapDE componentType) { 127 this.componentType = componentType; 128 } 129 132 public MapDE getPropertyProxy() { 133 return propertyProxy; 134 } 135 138 public void setPropertyProxy(MapDE propertyProxy) { 139 this.propertyProxy = propertyProxy; 140 } 141 144 public MapDE getValueType() { 145 return valueType; 146 } 147 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 |