1 /* |
|
2 * Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 /** |
|
19 * import midp classes. |
|
20 */ |
|
21 import javax.microedition.midlet.*; |
|
22 import javax.microedition.lcdui.*; |
|
23 |
|
24 /** |
|
25 * This is the main class for the Midp_General_03 tests. |
|
26 */ |
|
27 |
|
28 public class Midp_General_03 extends MIDlet implements CommandListener |
|
29 { |
|
30 |
|
31 private List emptyList; |
|
32 private Display display; |
|
33 private Command cmdExit = new Command("Exit", Command.EXIT, 1); |
|
34 |
|
35 public Midp_General_03() |
|
36 { |
|
37 emptyList = new List("List", List.EXCLUSIVE); |
|
38 emptyList.addCommand(cmdExit); |
|
39 emptyList.setCommandListener(this); |
|
40 display = Display.getDisplay(this); |
|
41 } |
|
42 |
|
43 /** |
|
44 * Signals the MIDlet to start and enter the Active state. |
|
45 */ |
|
46 protected void startApp() |
|
47 { |
|
48 display.setCurrent(emptyList); |
|
49 } |
|
50 |
|
51 /** |
|
52 * Signals the MIDlet to terminate and enter the Destroyed state. |
|
53 * |
|
54 */ |
|
55 protected void destroyApp(boolean unconditional) |
|
56 { |
|
57 } |
|
58 |
|
59 /** |
|
60 * Signals the MIDlet to stop and enter the Paused state. |
|
61 */ |
|
62 protected void pauseApp() |
|
63 { |
|
64 } |
|
65 |
|
66 /** |
|
67 * This method handles command invocations. |
|
68 * |
|
69 *@param c This is the command responsible for the event. |
|
70 *@param s Should be equal to this. |
|
71 */ |
|
72 public void commandAction(Command c, Displayable s) |
|
73 { |
|
74 if (c == cmdExit) |
|
75 { |
|
76 destroyApp(false); |
|
77 notifyDestroyed(); |
|
78 } |
|
79 } |
|
80 } |
|