Last change
on this file since 250 was 250, checked in by Nicholas Riley, 18 years ago |
Refactor editing, coalese Alarms and alarm list. Try (and fail) to recognize exit from alarm time editor.
|
File size:
942 bytes
|
Rev | Line | |
---|
[237] | 1 | package net.sabi.pester;
|
---|
| 2 |
|
---|
| 3 | import java.util.Comparator;
|
---|
| 4 | import danger.app.DataStore;
|
---|
[250] | 5 | import danger.util.StdActiveList;
|
---|
[237] | 6 |
|
---|
[250] | 7 | public class Alarms extends StdActiveList {
|
---|
[237] | 8 | // max # records in a datastore
|
---|
| 9 | private static final int MAX_ALARM_COUNT = 50;
|
---|
| 10 |
|
---|
[250] | 11 | private static Alarms sAlarmList = null;
|
---|
[237] | 12 | private static DataStore sDataStore;
|
---|
| 13 |
|
---|
| 14 | private Alarms() {
|
---|
| 15 | sDataStore = DataStore.createDataStore("alarms", true /* auto sync */);
|
---|
| 16 | }
|
---|
| 17 |
|
---|
[250] | 18 | public static Alarms getList() {
|
---|
| 19 | if (sAlarmList == null)
|
---|
| 20 | sAlarmList = new Alarms();
|
---|
| 21 | return sAlarmList;
|
---|
[237] | 22 | }
|
---|
| 23 |
|
---|
[250] | 24 | public static void addAlarm(Alarm alarm) {
|
---|
| 25 | sAlarmList.addItem(alarm);
|
---|
| 26 | }
|
---|
| 27 | public static void removeAlarm(Alarm alarm) {
|
---|
| 28 | sAlarmList.removeItem(alarm);
|
---|
| 29 | }
|
---|
| 30 |
|
---|
[237] | 31 | /*
|
---|
| 32 | private static Alarm sAlarm0 = new Alarm();
|
---|
| 33 | private static Alarm sAlarm1 = new Alarm();
|
---|
| 34 | public int compare(Object arg0, Object arg1) {
|
---|
| 35 |
|
---|
| 36 | return Collator.getInstance().compare(
|
---|
| 37 | }
|
---|
| 38 | */
|
---|
| 39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.