1 4 package org.oddjob.designer.elements.schedule; 5 6 import org.oddjob.designer.elements.date.DateAttribute; 7 import org.oddjob.designer.model.DesignDefinition; 8 import org.oddjob.designer.model.ElementField; 9 import org.oddjob.designer.model.FieldGroup; 10 import org.oddjob.designer.model.FieldSelection; 11 12 13 14 18 public class DateScheduleDE extends ParentSchedule { 19 20 private DateAttribute on; 21 private DateAttribute from; 22 private DateAttribute to; 23 24 public DateScheduleDE() { 25 setOn(new DateAttribute()); 26 setFrom(new DateAttribute()); 27 setTo(new DateAttribute()); 28 } 29 30 public DesignDefinition detail() { 31 return new FieldGroup(toString()) 32 .add(new FieldSelection() 33 .add(new FieldGroup("Dates") 34 .add(new ElementField("From", from)) 35 .add(new ElementField("To", to))) 36 .add(new ElementField("On", on))); 37 } 38 39 public void clear() { 40 on.clear(); 41 from.clear(); 42 to.clear(); 43 super.clear(); 44 } 45 46 public String toString() { 47 return "Date " + Util.constrainedToString(on, from, to); 48 } 49 50 public DateAttribute getFrom() { 51 return from; 52 } 53 54 public void setFrom(DateAttribute from) { 55 from.addObserver(detailObserver); 56 this.from = from; 57 } 58 59 public DateAttribute getOn() { 60 return on; 61 } 62 63 public void setOn(DateAttribute on) { 64 on.addObserver(detailObserver); 65 this.on = on; 66 } 67 68 public DateAttribute getTo() { 69 return to; 70 } 71 72 public void setTo(DateAttribute to) { 73 to.addObserver(detailObserver); 74 this.to = to; 75 } 76 } | Popular Tags |