KickJava   Java API By Example, From Geeks To Geeks.

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


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

4 package org.oddjob.designer.elements.scheduling;
5
6 import org.oddjob.designer.arooa.ElementWrapper;
7 import org.oddjob.designer.model.DesignDefinition;
8 import org.oddjob.designer.model.DesignElementAttribute;
9 import org.oddjob.designer.model.DesignElementType;
10 import org.oddjob.designer.model.MultiTypeTable;
11
12
13 /**
14  *
15  */

16 public class ScheduleListDE extends DesignElementAttribute {
17
18     public DesignDefinition detail() {
19         return new MultiTypeTable("A List", this)
20                 .setNamed(false);
21     }
22     
23     public ElementWrapper[] elements() {
24         return childElements();
25     }
26     
27     public String JavaDoc[] supportedTypes() {
28         return new String JavaDoc[] { "ojschedule", "cron", "trigger" };
29     }
30     
31     public DesignElementType createType(String JavaDoc type) {
32         DesignElementType det = null;
33         if ("ojschedule".equals(type)) {
34             det = new OJScheduleDE();
35         }
36         else if ("cron".equals(type)) {
37             det = new CronScheduleDE();
38         }
39         else if ("trigger".equals(type)) {
40             det = new TriggerScheduleDE();
41         }
42         else {
43             throw new IllegalArgumentException JavaDoc("No type [" + type + "]");
44         }
45         det.type(type);
46         return det;
47     }
48 }
49
Popular Tags