com.borland.primetime.properties
Class PropertyManager

java.lang.Object
  |
  +--com.borland.primetime.properties.PropertyManager

public class PropertyManager
extends java.lang.Object

Properties provides static methods for dealing with the collection of Property, PropertyPage, and PropertyGroup instances as a whole.

The method registerPropertyGroup adds a single property group to the collection of groups that will be initialized on startup and later queried to produce property pages when the property dialog is displayed.

The methods code>initializeProperties and writeProperties are used by a PrimeTime application to load global property on startup and save them at appropriate times.

The overloaded showPropertyDialog method displays a property dialog with the appropriate collection of PropertyPage instances. Clients that wish to check whether or not any pages are avaiable for a given topic may wish to use the getPageFactories method.


Method Summary
static Url getInstallRootUrl()
          Reports the location of the PrimeTime installation to assist in locating related files.
static PropertyPageFactory[] getPageFactories(java.lang.Object topic)
          Returns the array of PropertyPageFactory instances that can produce property pages for a given topic.
static Url getSettingsRootUrl()
          Returns the root location for all settings files.
static Url getSettingsUrl(java.lang.String name)
          Returns the location of an individual settings file, duplicating the default template file if necessary for first-time initialization.
static void initializeProperties(Url url)
           
static void readProperties()
          Reads the initial state of all global property stores and invokes the propertiesUpdated method of all registered PropertyGroup instances.
static void registerPropertyGroup(PropertyGroup group)
           
static boolean showPropertyDialog(java.awt.Component owner, java.lang.String title)
          Shows the property dialog for all global property pages.
static boolean showPropertyDialog(java.awt.Component owner, java.lang.String title, java.lang.Object topic, java.lang.String initialPage)
          Shows the property dialog for all property pages interested in a specific topic.
static boolean showPropertyDialog(java.awt.Component owner, java.lang.String title, java.lang.String initialPage)
          Shows the property dialog for all global property pages.
static void writeProperties()
          Checks all global property caches for changes since the last call to writeProperties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstallRootUrl

public static Url getInstallRootUrl()
Reports the location of the PrimeTime installation to assist in locating related files.
Returns:
A reference to the directory containing the PrimeTime classes.

getSettingsRootUrl

public static Url getSettingsRootUrl()
Returns the root location for all settings files. This value is specified when PropertyManager.initializeProperties is called to bootstrap the properties system and is typically a subdirectory of the user's home directory.
Returns:
A vaild Url representing the directory where properties are stored, or null if the properties system has not been initialized.

getSettingsUrl

public static Url getSettingsUrl(java.lang.String name)
Returns the location of an individual settings file, duplicating the default template file if necessary for first-time initialization.
Returns:
A vaild Url representing the requested settings file, or null if the properties system has not been initialized.

showPropertyDialog

public static boolean showPropertyDialog(java.awt.Component owner,
                                         java.lang.String title)
Shows the property dialog for all global property pages.
Parameters:
owner - The modal property dialog requires a visible component from which to infer the application Frame that owns the dialog.
title - The caption to be used for the properties dialog.

showPropertyDialog

public static boolean showPropertyDialog(java.awt.Component owner,
                                         java.lang.String title,
                                         java.lang.String initialPage)
Shows the property dialog for all global property pages. Automatically selects the page in the resulting dialog whose name matches the specified initial page name.
Parameters:
owner - The modal property dialog requires a visible component from which to infer the application Frame that owns the dialog.
title - The caption to be used for the properties dialog.
The - name of the initial page to be selected.

showPropertyDialog

public static boolean showPropertyDialog(java.awt.Component owner,
                                         java.lang.String title,
                                         java.lang.Object topic,
                                         java.lang.String initialPage)
Shows the property dialog for all property pages interested in a specific topic. Automatically selects the page in the resulting dialog whose name matches the specified initial page name.
Parameters:
owner - The modal property dialog requires a visible component from which to infer the application Frame that owns the dialog.
title - The caption to be used for the properties dialog.
topic - The topic for which property pages are desired. Requesting a topic of null is equivelant to requesting the global properties dialog.
The - name of the initial page to be selected.

initializeProperties

public static void initializeProperties(Url url)

readProperties

public static void readProperties()
Reads the initial state of all global property stores and invokes the propertiesUpdated method of all registered PropertyGroup instances.

writeProperties

public static void writeProperties()
Checks all global property caches for changes since the last call to writeProperties. If changes have been made they are saved to the appropriate storage.

registerPropertyGroup

public static void registerPropertyGroup(PropertyGroup group)

getPageFactories

public static PropertyPageFactory[] getPageFactories(java.lang.Object topic)
Returns the array of PropertyPageFactory instances that can produce property pages for a given topic.
Parameters:
topic - The topic for which property pages are desired. Requesting a topic of null is equivelant to requesting the global properties dialog.
Returns:
The length of the array indicates the number of pages that would be visible if the property dialog were displayed for this topic. When no pages are available an empty array will be returned rather than null.