1 4 package org.oddjob.designer.elements; 5 6 import org.oddjob.designer.elements.simple.FileAttribute; 7 import org.oddjob.designer.model.DesignDefinition; 8 import org.oddjob.designer.model.DesignElementType; 9 import org.oddjob.designer.model.ElementField; 10 import org.oddjob.designer.model.FieldGroup; 11 import org.oddjob.designer.model.FieldSelection; 12 import org.oddjob.designer.model.FileSelection; 13 14 17 public class PropertiesDE extends DesignElementType { 18 19 private FileAttribute file; 20 private InputDE input; 21 22 public PropertiesDE() { 23 setFile(new FileAttribute()); 24 setInput(new InputDE()); 25 } 26 27 public DesignDefinition detail() { 28 return new FieldGroup("From") 29 .add(new FieldSelection() 30 .add(new FileSelection("File", file)) 31 .add(new ElementField("Input", input))); 32 } 33 34 public void setFile(FileAttribute file) { 35 file.addObserver(detailObserver); 36 this.file = file; 37 } 38 39 public FileAttribute getFile() { 40 return file; 41 } 42 43 46 public InputDE getInput() { 47 return input; 48 } 49 50 53 public void setInput(InputDE input) { 54 input.addObserver(detailObserver); 55 this.input = input; 56 } 57 58 public void clear() { 59 file.clear(); 60 input.clear(); 61 super.clear(); 62 } 63 } 64 | Popular Tags |