DummyNamsMIDletpublic class DummyNamsMIDlet extends javax.microedition.midlet.MIDlet implements javax.microedition.lcdui.CommandListenerBase class for several Dummy MIDlets used in NAMS I3 testing |
Fields Summary |
---|
protected String | name | private javax.microedition.lcdui.Command | cmdMgr | private javax.microedition.lcdui.Command | cmdHide | private javax.microedition.lcdui.Command | cmdPause | private javax.microedition.lcdui.Command | cmdDestroy | private javax.microedition.lcdui.Form | formmain midlet screen |
Constructors Summary |
---|
public DummyNamsMIDlet(String dummyName)public constructor
int i;
name = dummyName;
cmdDestroy = new Command("Destroy", Command.EXIT, 0);
cmdPause = new Command("Pause", Command.STOP, 0);
cmdHide = new Command("Hide", Command.SCREEN, 0);
cmdMgr = new Command("Show Manager", Command.SCREEN, 0);
form = new Form(name + " screen");
form.addCommand(cmdMgr);
form.addCommand(cmdHide);
form.addCommand(cmdPause);
form.addCommand(cmdDestroy);
form.setCommandListener(this);
Logging.report(Logging.WARNING, LogChannels.LC_CORE,
"DEBUG: " + name + ": created in isolate #" +
MIDletSuiteUtils.getIsolateId());
|
Methods Summary |
---|
public void | commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable s)
if (c == cmdDestroy) {
/*
Logging.report(Logging.WARNING, LogChannels.LC_CORE,
"DEBUG: " + name + ": user requested to destroy ...");
*/
try {
destroyApp(true);
} catch (MIDletStateChangeException e) {};
} else if (c == cmdPause) {
/*
Logging.report(Logging.WARNING, LogChannels.LC_CORE,
"DEBUG: " + name + ": user requested to pause ...");
*/
pauseApp();
} else if (c == cmdHide) {
/*
Logging.report(Logging.WARNING, LogChannels.LC_CORE,
"DEBUG: " + name + ": user requested to go to background ...");
*/
NamsManager.midletSetBackground();
} else if (c == cmdMgr) {
/*
Logging.report(Logging.WARNING, LogChannels.LC_CORE,
"DEBUG: " + name + ": user requested to show NamsManager ...");
*/
NamsManager.midletSetForeground(0);
}
| protected void | destroyApp(boolean unconditional)
Logging.report(Logging.WARNING, LogChannels.LC_CORE,
"DEBUG: " + name + ": entered destroyed state ...");
notifyDestroyed();
| protected void | pauseApp()
Logging.report(Logging.WARNING, LogChannels.LC_CORE,
"DEBUG: " + name + ": entered paused state ...");
notifyPaused();
| protected void | startApp()
Logging.report(Logging.WARNING, LogChannels.LC_CORE,
"DEBUG: " + name + ": entered active state ...");
Display.getDisplay(this).setCurrent(form);
|
|