KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > elements > schedule > CountScheduleDE


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

4 package org.oddjob.designer.elements.schedule;
5
6 import org.oddjob.designer.elements.simple.NumberAttribute;
7 import org.oddjob.designer.model.DesignDefinition;
8 import org.oddjob.designer.model.ElementField;
9 import org.oddjob.designer.model.FieldGroup;
10
11
12 /**
13  * Count Schedule.
14  *
15  */

16 public class CountScheduleDE extends ParentSchedule {
17     
18     private NumberAttribute count;
19     
20     public CountScheduleDE() {
21         setCount(new NumberAttribute());
22     }
23     
24     public NumberAttribute getCount() {
25         return count;
26     }
27     
28     public void setCount(NumberAttribute count) {
29         count.addObserver(detailObserver);
30         this.count = count;
31     }
32
33     public DesignDefinition detail() {
34         return new FieldGroup(toString())
35             .add(new ElementField("Count", count));
36     }
37     
38     public String JavaDoc toString() {
39         return "Count " + (count.attribute() == null
40                 ? "" : count.attribute());
41     }
42     
43     public void clear() {
44         count.clear();
45         super.clear();
46     }
47 }
Popular Tags