1 4 package org.oddjob.designer.components; 5 6 import org.oddjob.designer.elements.FilesDE; 7 import org.oddjob.designer.elements.InputDE; 8 import org.oddjob.designer.elements.ListDE; 9 import org.oddjob.designer.elements.OutputDE; 10 import org.oddjob.designer.elements.simple.FileAttribute; 11 import org.oddjob.designer.factory.DesignFactory; 12 import org.oddjob.designer.model.ElementField; 13 import org.oddjob.designer.model.FieldGroup; 14 import org.oddjob.designer.model.FieldSelection; 15 import org.oddjob.designer.model.FileSelection; 16 import org.oddjob.designer.model.FormDefinition; 17 import org.oddjob.designer.model.StandardForm; 18 19 22 public class CopyDC extends BaseDC { 23 24 private ListDE from = new ListDE(); 25 private FileAttribute to = new FileAttribute(); 26 private InputDE input = new InputDE(); 27 private OutputDE output = new OutputDE(); 28 29 public FormDefinition form() { 30 return 31 new StandardForm(tag()) 32 .addGroup(basePanel()) 33 .addGroup(new FieldGroup("From") 34 .add(new FieldSelection() 35 .add(new ElementField("File(s)/Dir(s)", from)) 36 .add(new ElementField("Input", input)))) 37 .addGroup(new FieldGroup("To") 38 .add(new FieldSelection() 39 .add(new FileSelection("File/Dir", to)) 40 .add(new ElementField("Output", output)))); 41 } 42 43 public void setFrom(ListDE from) { 44 from.supportedTypes(DesignFactory.supportedTypes(FilesDE.class)); 45 this.from = from; 46 } 47 48 public ListDE getFrom() { 49 return from; 50 } 51 52 public void setTo(FileAttribute to) { 53 this.to = to; 54 } 55 56 public FileAttribute getTo() { 57 return to; 58 } 59 60 63 public InputDE getInput() { 64 return input; 65 } 66 69 public void setInput(InputDE input) { 70 this.input = input; 71 } 72 75 public OutputDE getOutput() { 76 return output; 77 } 78 81 public void setOutput(OutputDE output) { 82 this.output = output; 83 } 84 } 85 | Popular Tags |