KickJava   Java API By Example, From Geeks To Geeks.

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


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

4 package org.oddjob.designer.elements.scheduling;
5
6 import org.oddjob.designer.elements.simple.ReferenceAttribute;
7 import org.oddjob.designer.elements.simple.SimpleTextAttribute;
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 TriggerScheduleDE extends ScheduleInstructionDE {
16
17     private ReferenceAttribute on;
18     private SimpleTextAttribute state;
19     
20     public TriggerScheduleDE() {
21         setOn(new ReferenceAttribute());
22         setState(new SimpleTextAttribute());
23     }
24     
25     public DesignDefinition detail() {
26         return new FieldGroup("Schedule Details")
27             .add(new ElementField("Job To Schedule", getJob()))
28             .add(new ElementField("Schedule Id", getId()))
29             .add(new ElementField("Schedule Name", getName()))
30             .add(new ElementField("Trigger On", on))
31             .add(new ElementField("State", state));
32     }
33
34     /**
35      * @return Returns the state.
36      */

37     public SimpleTextAttribute getState() {
38         return state;
39     }
40     
41     /**
42      * @param state The state to set.
43      */

44     public void setState(SimpleTextAttribute state) {
45         state.addObserver(detailObserver);
46         this.state = state;
47     }
48
49     public ReferenceAttribute getOn() {
50         return on;
51     }
52
53     public void setOn(ReferenceAttribute triggerOn) {
54         triggerOn.addObserver(detailObserver);
55         this.on = triggerOn;
56     }
57
58     
59 }
60
Popular Tags