DisplayManagerFactory.javaAPI DocJ2ME MIDP 2.02485Thu Nov 07 12:02:22 GMT 2002com.sun.midp.lcdui


public class DisplayManagerFactory extends Object
This class works around the fact that public classes can not be added to a javax package by an implementaion.

Fields Summary
private static DisplayManager
The real implementation of the display manager.
private static
This class has a different security domain than the MIDlet suite
Constructors Summary
Methods Summary
public static voidSetDisplayManagerImpl(DisplayManager dm)
Set the implemetation of the display manager, if one is not already set.

This implementaion class will be in the as the Display class for security. But needs placed here to be visible to com.sun.midp classes.

dm reference to the system display manager

        if (managerImpl != null) {

        managerImpl = dm;
public static DisplayManagergetDisplayManager()
Return a reference to the singleton display manager object.

display manager reference.

        if (managerImpl != null) {
            return managerImpl;

         * The display manager implementation is a private class of Display
         * and is create in the class init of Display, we need to call a
         * static method of display to get the class init to run, because
         * some classes need to get the display manager to create a display
        try {
            // this will yield a null pointer exception on purpose
        } catch (NullPointerException npe) {
            // this is normal for this case, do nothing

        return managerImpl;
public static voidinitSecurityToken( token)
Initializes the security token for this class, so it can perform actions that a normal MIDlet Suite cannot.

token security token for this class.

	if (displayClassSecurityToken != null) {
	displayClassSecurityToken = token;