com.ibm.as400.ui.framework.java
Class UIFramework

java.lang.Object
  |
  +--com.ibm.as400.ui.framework.java.UIFramework

public abstract class UIFramework
extends java.lang.Object

This class keeps track of global properties for this package. UIFramework contains settings that control how the application's resources are managed, and whether the look and feel of user interface panels should be set to conform to that of the current operating system platform.

On initial startup, applications should ensure that the values set are consistent with the desired behavior for the framework.

Since:
v4r2m0

Field Summary
static int BYPASS_CACHED_RESOURCES
          Indicates that the UI framework should not use cached resource bundles.
static int CHECK_FOR_SERIALIZED
          Indicates that the UI framework should check for a serialized panel definition.
static int ONLY_PARSE_XML
          Indicates that the UI framework should not check for a serialized panel definition.
static int ONLY_USE_SERIALIZED
          Indicates that the UI framework should only use serialized panel definitions.
static int USE_CACHED_RESOURCES
          Indicates that the UI framework should use cached resource bundles.
 
Method Summary
static int getResourceMode()
          Returns the current resource mode for the UI framework.
static int getSearchMode()
          Returns the current search mode for the UI framework.
static int getVersion()
          Returns the version of the AS/400 Graphical Toolbox.
static boolean isApplet()
          Determines whether the UI framework is to be run as an Applet
static boolean isSystemLookAndFeelEnabled()
          Determines whether the UI framework will set the system look and feel for the current operating system.
static void notifyGlobalRegisteredListeners(java.awt.Window window, boolean show)
           
static void registerSetVisibleInterest(java.lang.Object c, java.lang.reflect.Method m)
          Registers a method that is notified on calls to setVisible()
static void removeSetVisibleInterest(java.lang.reflect.Method m)
          Removes a registered interest
static void setApplet(boolean applet)
          Controls whether the UI framework is running as an Applet.
static void setResourceMode(int resourceMode)
          Controls whether the UI framework should use cached resource bundles.
static void setSearchMode(int searchMode)
          Controls where the UI framework should obtain panel definitions for panels associated with the current application.
static void setSystemLookAndFeelEnabled(boolean enabled)
          Controls whether the UI framework should attempt to set the look and feel for the current operating system platform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_CACHED_RESOURCES

public static final int USE_CACHED_RESOURCES
Indicates that the UI framework should use cached resource bundles. When a resource bundle is initially loaded it is added to a system cache. Subsequent requests for the resource bundle will be satisfied from this cache.

BYPASS_CACHED_RESOURCES

public static final int BYPASS_CACHED_RESOURCES
Indicates that the UI framework should not use cached resource bundles. All requests for a particular resource bundle will cause the resources to be reloaded from an external source, such as a local hard drive or a location on the network.

ONLY_USE_SERIALIZED

public static final int ONLY_USE_SERIALIZED
Indicates that the UI framework should only use serialized panel definitions. If a serialized definition for a panel is not found an exception will be thrown.

CHECK_FOR_SERIALIZED

public static final int CHECK_FOR_SERIALIZED
Indicates that the UI framework should check for a serialized panel definition. If the serialized file is not found, the panel definition should be obtained by parsing the PDML document.

ONLY_PARSE_XML

public static final int ONLY_PARSE_XML
Indicates that the UI framework should not check for a serialized panel definition. Panel definitions should always be obtained by parsing an PDML document.
Method Detail

getResourceMode

public static int getResourceMode()
Returns the current resource mode for the UI framework.
Returns:
one of the pre-defined resource mode constants
Since:
v4r2m0
See Also:
setResourceMode(int)

setResourceMode

public static void setResourceMode(int resourceMode)
Controls whether the UI framework should use cached resource bundles. Defaults to USE_CACHED_RESOURCES.
Parameters:
resourceMode - one of the pre-defined resource mode constants
Since:
v4r2m0
See Also:
getResourceMode()

getSearchMode

public static int getSearchMode()
Returns the current search mode for the UI framework.
Returns:
one of the pre-defined search mode constants
Since:
v4r2m0
See Also:
setSearchMode(int)

setSearchMode

public static void setSearchMode(int searchMode)
Controls where the UI framework should obtain panel definitions for panels associated with the current application. Defaults to CHECK_FOR_SERIALIZED.
Parameters:
searchMode - one of the pre-defined search mode constants
Since:
v4r2m0
See Also:
getSearchMode()

isSystemLookAndFeelEnabled

public static boolean isSystemLookAndFeelEnabled()
Determines whether the UI framework will set the system look and feel for the current operating system.
Returns:
true if the system look and feel will be set; false otherwise.
Since:
v4r2m0
See Also:
setSystemLookAndFeelEnabled(boolean)

setSystemLookAndFeelEnabled

public static void setSystemLookAndFeelEnabled(boolean enabled)
Controls whether the UI framework should attempt to set the look and feel for the current operating system platform. Defaults to true.
Parameters:
enabled - If true, set the system look and feel; otherwise, do nothing.
Since:
v4r2m0
See Also:
isSystemLookAndFeelEnabled()

notifyGlobalRegisteredListeners

public static void notifyGlobalRegisteredListeners(java.awt.Window window,
                                                   boolean show)

registerSetVisibleInterest

public static void registerSetVisibleInterest(java.lang.Object c,
                                              java.lang.reflect.Method m)
Registers a method that is notified on calls to setVisible()

Parameters:
c - The object that wishes to be notified
m - the method on the object to be called. The method's paramateres are (java.awt.Window, java.lang.Boolean)
Since:
v5r1m0

removeSetVisibleInterest

public static void removeSetVisibleInterest(java.lang.reflect.Method m)
Removes a registered interest

Parameters:
m - the method that was registered
Since:
v5r1m0

isApplet

public static boolean isApplet()
Determines whether the UI framework is to be run as an Applet
Returns:
true if the UI framework is in Applet mode; false otherwise.
Since:
v4r2m0
See Also:
setApplet(boolean)

setApplet

public static void setApplet(boolean applet)
Controls whether the UI framework is running as an Applet. Defaults to false.
Parameters:
appplet - If true, the UI framework should run in Applet mode
Since:
v5r2m0
See Also:
isApplet()

getVersion

public static int getVersion()
Returns the version of the AS/400 Graphical Toolbox.
Returns:
the Toolbox version, release and modification level as a hex integer of the form 0x00vvrrmm
Since:
v4r2m0