KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > elements > scheduling > OJScheduleDE


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

4 package org.oddjob.designer.elements.scheduling;
5
6 import org.oddjob.designer.elements.ScheduleDE;
7 import org.oddjob.designer.elements.date.TimeZoneAttribute;
8 import org.oddjob.designer.model.DesignDefinition;
9 import org.oddjob.designer.model.ElementField;
10 import org.oddjob.designer.model.FieldGroup;
11
12 /**
13  *
14  */

15 public class OJScheduleDE extends ScheduleInstructionDE {
16
17     private TimeZoneAttribute timeZone;
18     private ScheduleDE schedule;
19     private ScheduleDE retry;
20
21     public OJScheduleDE() {
22         setTimeZone(new TimeZoneAttribute());
23         setSchedule(new ScheduleDE());
24         setRetry(new ScheduleDE());
25     }
26     
27     public DesignDefinition detail() {
28         return new FieldGroup("Schedule Details")
29             .add(new ElementField("Job To Schedule", getJob()))
30             .add(new ElementField("Schedule Id", getId()))
31             .add(new ElementField("Schedule Name", getName()))
32             .add(new ElementField("Time Zone", timeZone))
33             .add(new ElementField("Schedule", schedule))
34             .add(new ElementField("Retry", retry));
35     }
36         
37         
38     public void setTimeZone(TimeZoneAttribute timeZone) {
39         timeZone.addObserver(detailObserver);
40         this.timeZone = timeZone;
41     }
42     
43     public TimeZoneAttribute getTimeZone() {
44         return this.timeZone;
45     }
46     
47     public void setSchedule(ScheduleDE schedule) {
48         schedule.addObserver(detailObserver);
49         this.schedule = schedule;
50     }
51     
52     public ScheduleDE getSchedule() {
53         return schedule;
54     }
55
56     public void setRetry(ScheduleDE retry) {
57         retry.addObserver(detailObserver);
58         this.retry = retry;
59     }
60     
61     public ScheduleDE getRetry() {
62         return retry;
63     }
64     
65     public void clear() {
66         timeZone.clear();
67         schedule.clear();
68         retry.clear();
69     }
70 }
71
Popular Tags