FileDocCategorySizeDatePackage
PMidletManager.javaAPI DocphoneME MR2 API (J2ME)3198Wed May 02 18:00:08 BST 2007com.sun.mtask.midlet

PMidletManager

public class PMidletManager extends Object implements sun.mtask.AppModelManager
Proxy MIDlet Manager.

Fields Summary
private static com.sun.midp.main.MIDletProxyList
proxyList
Current proxy list.
private static com.sun.midp.main.MIDletProxy
lastForegroundMidlet
Most recent foreground MIDlet.
private static boolean
verbose
Verbose debug output flag.
Constructors Summary
Methods Summary
public voidactivate()
Activate myself.

        if (lastForegroundMidlet != null) {
            proxyList.setForegroundMIDlet(lastForegroundMidlet);
            lastForegroundMidlet = null;
        }
    
public voiddeactivate()
Deactivate myself.

        if (lastForegroundMidlet == null) {
	    if (proxyList == null) {
	        proxyList = MIDletProxyList.getMIDletProxyList();
            }
            lastForegroundMidlet = proxyList.getForegroundMIDlet();
        }
        proxyList.setForegroundMIDlet(null);
    
public booleanprocessMessage(java.lang.String s, java.lang.String messageId)
Process incoming message for this app model

param
s target application type
param
messageId message identifier (currently unused)
return
true if action was performed

        if (!s.startsWith("MIDLET_")) {
            return false;
        }
        s = s.substring(7);
        if (verbose) {
	    System.err.println("MIDLET MESSAGE=\""+s+"\"");
        }
        if (s.startsWith("ACTIVATE")) {
            activate();
        } else if (s.startsWith("DEACTIVATE")) {
            deactivate();
        } else {
            return false;
        }
        return true;
    
public voidregister()
Register this app model manager with the system.


     
        PMidletManager pmm = new PMidletManager();
        try {
            Listener.setAppModelManager(pmm);
        } catch (Throwable e) {
	    // The Listener is not created. Do nothing.
        }