FileDocCategorySizeDatePackage
IndicatorManager.javaAPI DocphoneME MR2 API (J2ME)4297Wed May 02 18:00:04 BST 2007com.sun.midp.main

IndicatorManager

public class IndicatorManager extends Object implements MIDletProxyListListener
IndicatorManager is a singleton class that controls the home icon status in status bar.

Fields Summary
private static IndicatorManager
singleton
singleton variable
private static boolean
homeIconState
boolean flag that indicated home icon status
private static MIDletProxyList
midletProxyList
Internal midletProxyList that is used to add listener
Constructors Summary
private IndicatorManager()
IndicatorManager is a singleton.

    
Methods Summary
public static booleangetHomeIconState()
This function is public so that unit test can refer it

return
state of the home icon

        return homeIconState;
    
public static voidinit(MIDletProxyList theMidletProxyList)
A static method that initialize singleton IndicatorBar class

param
theMidletProxyList a reference to the MIDlet proxy list

        if (singleton == null) {
            midletProxyList = theMidletProxyList;
            singleton = new IndicatorManager();
            midletProxyList.addListener(singleton);
        }
    
public voidmidletAdded(MIDletProxy midlet)
Called when a MIDlet is added to the list.

param
midlet The proxy of the MIDlet being added

        // IndicatorManager does not care if midlet is added
    
public voidmidletRemoved(MIDletProxy midlet)
Called when a MIDlet is removed from the list.

param
midlet The proxy of the MIDlet being removed

        setHomeIconState(midletProxyList.isAlertWaitingInBackground());
    
public voidmidletStartError(int externalAppId, int suiteId, java.lang.String className, int errorCode, java.lang.String errorDetails)
Called when error occurred while starting a MIDlet object.

param
externalAppId ID assigned by the external application manager
param
suiteId Suite ID of the MIDlet
param
className Class name of the MIDlet
param
errorCode start error code
param
errorDetails start error details

public voidmidletUpdated(MIDletProxy midlet, int fieldId)
Called when the state of a MIDlet in the list is updated.

param
midlet The proxy of the MIDlet being updated
param
fieldId code for which field of the proxy was updated

        setHomeIconState(midletProxyList.isAlertWaitingInBackground());
    
private static voidsetHomeIconState(boolean newHomeIconState)
This method is called whenever home icon needs to be turned on/off

param
newHomeIconState boolean flag to indicate status of home icon

        if (homeIconState != newHomeIconState) {
            homeIconState = newHomeIconState;
            toggleHomeIcon0(homeIconState);
        }
    
private static native voidtoggleHomeIcon0(boolean isHomeOn)
Native method to toggle the home icon

param
isHomeOn : boolean flag to indicate status of home icon