Last change
on this file since 242 was 242, checked in by Nicholas Riley, 18 years ago |
Basic functionality works.
|
File size:
1.0 KB
|
Line | |
---|
1 | package net.sabi.pester;
|
---|
2 |
|
---|
3 | import danger.app.Application;
|
---|
4 | import danger.app.Event;
|
---|
5 | import danger.ui.AlertWindow;
|
---|
6 | import danger.ui.ScreenWindow;
|
---|
7 | import danger.util.DEBUG;
|
---|
8 | import java.util.Stack;
|
---|
9 |
|
---|
10 | public class Pester extends Application implements Resources, Commands {
|
---|
11 | private static ScreenWindow sAlarmListWindow;
|
---|
12 | private static Stack sAlarmStack;
|
---|
13 |
|
---|
14 | public Pester() {
|
---|
15 | sAlarmListWindow = (ScreenWindow)getResources().getScreen(ID_ALARM_LIST_SCREEN);
|
---|
16 | sAlarmListWindow.show();
|
---|
17 | sAlarmStack = new Stack();
|
---|
18 | }
|
---|
19 |
|
---|
20 | public boolean receiveEvent(Event e) {
|
---|
21 | switch (e.type) {
|
---|
22 | case Event.EVENT_ALARM:
|
---|
23 | Alarm alarm = (Alarm)e.argument;
|
---|
24 | AlertWindow alert = getAlert(ID_ALARM_ALERT, this);
|
---|
25 | alert.setMessage(alarm.getMessage());
|
---|
26 | // alert.setMessageFormatDate(alarm.getDate());
|
---|
27 | alert.show(AlertWindow.SYSTEM_ALERT_TYPE_ALARM);
|
---|
28 | sAlarmStack.push(alarm);
|
---|
29 | return true;
|
---|
30 | case EVENT_DISMISS_ALARM:
|
---|
31 | ((Alarm)sAlarmStack.pop()).dismiss();
|
---|
32 | return true;
|
---|
33 | }
|
---|
34 | return super.receiveEvent(e);
|
---|
35 | }
|
---|
36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.