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_01 tests. |
|
26 */ |
|
27 |
|
28 public class Midp_General_01 extends MIDlet implements CommandListener |
|
29 { |
|
30 private Form theForm; |
|
31 private Command cmdExit = new Command("Exit", Command.EXIT, 1); |
|
32 |
|
33 /** |
|
34 * Signals the MIDlet to start and enter the Active state. |
|
35 */ |
|
36 protected void startApp() |
|
37 { |
|
38 theForm = new EmptyForm(this); |
|
39 theForm.addCommand(cmdExit); |
|
40 theForm.setCommandListener(this); |
|
41 } |
|
42 |
|
43 /** |
|
44 * Signals the MIDlet to terminate and enter the Destroyed state. |
|
45 * |
|
46 */ |
|
47 protected void destroyApp(boolean unconditional) |
|
48 { |
|
49 } |
|
50 |
|
51 /** |
|
52 * Signals the MIDlet to stop and enter the Paused state. |
|
53 */ |
|
54 protected void pauseApp() |
|
55 { |
|
56 } |
|
57 |
|
58 /** |
|
59 * This method handles command invocations. |
|
60 * |
|
61 *@param c This is the command responsible for the event. |
|
62 *@param s Should be equal to this. |
|
63 */ |
|
64 public void commandAction(Command c, Displayable s) |
|
65 { |
|
66 if (c == cmdExit) |
|
67 { |
|
68 destroyApp(false); |
|
69 notifyDestroyed(); |
|
70 } |
|
71 } |
|
72 } |
|