KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > elements > date > TimeZoneAttribute


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

4 package org.oddjob.designer.elements.date;
5
6 import java.util.TimeZone JavaDoc;
7
8 import org.oddjob.designer.model.DesignDefinition;
9 import org.oddjob.designer.model.SelectionList;
10 import org.oddjob.designer.model.SimpleAttribute;
11
12 /**
13  *
14  */

15 public class TimeZoneAttribute extends SimpleAttribute {
16
17     class TimeZoneSL extends SelectionList {
18         TimeZoneSL(String JavaDoc title) {
19             super(title);
20         }
21         /* (non-Javadoc)
22          * @see org.oddjob.designer.model.SelectionList#getOptions()
23          */

24         public String JavaDoc[] getOptions() {
25             return TimeZone.getAvailableIDs();
26         }
27         
28         /* (non-Javadoc)
29          * @see org.oddjob.designer.model.SelectionList#getSelected()
30          */

31         public String JavaDoc getSelected() {
32             return attribute();
33         }
34         
35         /* (non-Javadoc)
36          * @see org.oddjob.designer.model.SelectionList#setSelected(java.lang.String)
37          */

38         public void setSelected(String JavaDoc selected) {
39             attribute(selected);
40         }
41         
42         /* (non-Javadoc)
43          * @see org.oddjob.designer.model.DesignDefinition#isPopulated()
44          */

45         public boolean isPopulated() {
46             return attribute() != null;
47         }
48         
49     }
50     
51     public DesignDefinition detail() {
52         return new TimeZoneSL("Time Zone");
53     }
54     
55     
56 }
57
Popular Tags