All Packages  Class Hierarchy  This Package  Previous  Next  Index

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

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

public class PropertySheetManager
extends Object
implements PaneManager, WindowManager
Creates a property sheet containing a tabbed pane with one or more tabbed windows. Each window consists of a panel defined using the Panel Definition Markup Language (PDML). The property sheet may be either a standalone window or a modal dialog.

PropertySheetManager performs the following processing on behalf of the application:

The total size of the property sheet is a function of the size of the largest panel.

To locate a property sheet definition, PropertySheetManager needs three pieces of information:

The framework first searches the specified location for a file with a name matching the property sheet name, and an extension of .pdml.ser. If the serialized property sheet definition is not found, an attempt will be made to load a ResourceBundle and a PDML file which correspond to the specified resource name. If the resources cannot be located a DisplayManagerException will be thrown.

Examples

Assume that the property sheet MyPropertySheet is defined in the file TestPanels.pdml, and that a properties file TestPanels.properties is associated with the property sheet definition. Both files reside in the directory com/ourCompany/ourPackage, which is accessible from a directory defined in the classpath, or from a ZIP or JAR file defined in the classpath. The following code creates the property sheet and displays it:

 import com.ibm.as400.ui.framework.java.*;
  
 // Create the property sheet manager. Parameters:
 // 1. Resource name of the property sheet definition
 // 2. Name of property sheet
 // 3. List of DataBeans omitted
  
 try {
 PropertySheetManager psm = new PropertySheetManager("com.ourCompany.ourPackage.TestPanels",
                                                     "MyPropertySheet",
                                                      null);
 }
 catch (DisplayManagerException e) {
 e.displayUserMessage(null);
 System.exit(-1);
 }
  
 // Display the property sheet
 psm.setVisible(true);
 
Once the DataBeans that supply data to the property sheet have been implemented and the attributes have been identified in the PDML, the following code may be used to construct a fully-functioning property sheet:

 import com.ibm.as400.ui.framework.java.*;
 import java.awt.Frame;
  
 // Instantiate the objects which supply data to the property sheet
 TestDataBean1 db1 = new TestDataBean1();
 TestDataBean2 db2 = new TestDataBean2();
  
 // Initialize the objects
 db1.load();
 db2.load();
  
 // Set up to pass the objects to the UI framework
 DataBean[] dataBeans = { db1, db2 };
  
 // Create the property sheet manager. Parameters:
 // 1. Resource name of the property sheet definition
 // 2. Name of property sheet
 // 3. List of DataBeans
 // 4. Owner frame window
  
 Frame owner;
 ...
 try {
 PropertySheetManager psm = new PropertySheetManager("com.ourCompany.ourPackage.TestPanels",
                                                     "MyPropertySheet",
                                                     dataBeans,
                                                     owner);
 }
 catch (DisplayManagerException e) {
 e.displayUserMessage(null);
 System.exit(-1);
 }
  
 // Display the property sheet
 psm.setVisible(true);
 

Command Line Interface

The command line interface may be used to display newly-defined property sheets, or to serialize PDML property sheet definitions.
 java com.ibm.as400.ui.framework.java.PropertySheetManager
     [-serialize]
     [-locale <language code>_<country code>_<variant>]
     <resource name>
     <property sheet name>
 
Options:
-serialize
Parses the PDML property sheet definition and creates a serialized version of the property sheet. The name of the serialized file will match the property sheet name, and the file extension will be .pdml.ser. If this option is specified the property sheet will not be displayed on the screen.

-locale <language code>_<country code>_<variant>
Identifies the locale which should be used to locate the property sheet definition. The locale string should consist of a two-letter lowercase ISO Language Code, a two-letter uppercase ISO country code, and an optional variant string, each delimited by an underscore ("_") character. If this parameter is omitted the default locale will be used. If resources for the default locale cannot be found, an attempt will be made to use the base resources for the property sheet.

<resource name>
The fully-qualified resource name of the PDML document/resource bundle combination which defines the property sheet specification.

<property sheet name>
The name of the property sheet, as specified on the PROPERTYSHEET tag in the PDML document.

Examples:

Test a base sample property sheet:

java com.ibm.as400.ui.framework.java.PropertySheetManager com.ourCompany.ourPackage.TestPanels MyPropertySheet

Serialize the base property sheet:

java com.ibm.as400.ui.framework.java.PropertySheetManager -serialize com.ourCompany.ourPackage.TestPanels MyPropertySheet

Test the UK version:

java com.ibm.as400.ui.framework.java.PropertySheetManager -locale en_UK com.ourCompany.ourPackage.TestPanels MyPropertySheet

Serialize the UK version:

java com.ibm.as400.ui.framework.java.PropertySheetManager -serialize -locale en_UK com.ourCompany.ourPackage.TestPanels MyPropertySheet

See Also:
DisplayManagerException, PanelManager

Constructor Index

 o PropertySheetManager(String, Locale, String)
Constructs a PropertySheetManager object for the specified property sheet, and then serializes the property sheet definition.
 o PropertySheetManager(String, Locale, String, DataBean[])
Constructs a PropertySheetManager object for the specified property sheet.
 o PropertySheetManager(String, Locale, String, DataBean[], Container)
Constructs a PropertySheetManager for the specified property sheet, using the specified container.
 o PropertySheetManager(String, Locale, String, DataBean[], Frame)
Constructs a PropertySheetManager object for the specified property sheet.
 o PropertySheetManager(String, String, DataBean[])
Constructs a PropertySheetManager object for the specified property sheet.
 o PropertySheetManager(String, String, DataBean[], Container)
Constructs a PropertySheetManager for the specified property sheet, using the specified container.
 o PropertySheetManager(String, String, DataBean[], Frame)
Constructs a PropertySheetManager object for the specified property sheet.

Method Index

 o activatePanel()
Runs the activation handlers for the currently selected pane.
 o addCancelListener(ActionListener)
Adds an ActionListener which is notified when the user cancels out of a window.
 o addCommitListener(ActionListener)
Adds an ActionListener which is notified when commit processing is complete.
 o applyChanges()
Transmits changes to user data to the DataBeans which manage the data.
 o commit(Vector)
Commits the changes to data displayed on the panel.
 o getComponent(String)
Returns the requested user interface component.
 o getComponentDescriptor(String)
Returns the JavaComponentDescriptor for the specified user interface component.
 o getDelegateManager(String)
Returns the PaneManager to which the receiver is delegating management of the specified subpane.
 o getExitOnClose()
Determines whether the application exits when this property sheet is closed.
 o getFormatter(String)
Returns the data formatter associated with the specified user interface component.
 o getPage(int)
Returns the PanelManager for the specified property page.
 o getPreferredSize()
Gets the preferred size of this property sheet.
 o getTitle()
Returns the property sheet's title.
 o getWindow()
Returns the main property sheet window.
 o isVisible()
Determines whether this property sheet is visible.
 o loadData()
Called during initialization to load data into the panel.
 o main(String[])
Provides a command line interface to PropertySheetManager.
 o prepareToCommit(Vector)
Request the DataBeans which manage data for the panel to verify that their data is in a consistent state.
 o serialize()
Serializes the property sheet definition.
 o setAggregateManager(PaneManager)
Sets the owning PaneManager for the receiver.
 o setExitOnClose(boolean)
Controls whether the application exits when the property sheet is closed, based on the value of parameter exit.
 o setFormatter(String, DataFormatter, boolean)
Sets the data formatter associated with the specified user interface component.
 o setHelpPath(String)
 o setModalRelativeTo(WindowManager)
Sets the location of the panel being managed relative to a panel managed by the specified WindowManager.
 o setTitle(String)
Overrides the property sheet title defined in the property sheet definition.
 o setVisible(boolean)
Shows or hides the property sheet, depending on the value of parameter show.
 o showPage(int)
Shows the Panel for the specified property page.
 o showPane(String)
Displays the specified pane.

Constructors

 o PropertySheetManager
 public PropertySheetManager(String baseName,
                             String propertySheetName,
                             DataBean dataBeans[]) throws DisplayManagerException
Constructs a PropertySheetManager object for the specified property sheet. The property sheet will be modeless.

The default locale will be used to load the property sheet definition.

Parameters:
baseName - the resource name of the PDML document/resource bundle combination which define the property sheet specification
propertySheetName - the name of the property sheet, as specified on the PROPERTYSHEET tag in the PDML document
dataBeans - a list of DataBeans which supply data to the property sheet (may be null)
Throws: DisplayManagerException
if an error was encountered accessing the panel definition
See Also:
DisplayManagerException
 o PropertySheetManager
 public PropertySheetManager(String baseName,
                             Locale locale,
                             String propertySheetName,
                             DataBean dataBeans[]) throws DisplayManagerException
Constructs a PropertySheetManager object for the specified property sheet. The property sheet will be modeless.

Parameters:
baseName - the resource name of the PDML document/resource bundle combination which define the property sheet specification
locale - the desired locale to be used to load the property sheet definition
propertySheetName - the name of the property sheet, as specified on the PROPERTYSHEET tag in the PDML document
dataBeans - a list of DataBeans which supply data to the property sheet (may be null)
Throws: DisplayManagerException
if an error was encountered accessing the panel definition
See Also:
DisplayManagerException
 o PropertySheetManager
 public PropertySheetManager(String baseName,
                             String propertySheetName,
                             DataBean dataBeans[],
                             Frame owner) throws DisplayManagerException
Constructs a PropertySheetManager object for the specified property sheet. The property sheet will be modal, with the specified Frame as its owner. The application will block on the call to setVisible until the property sheet has closed.

The default locale will be used to load the panel definition.

Parameters:
baseName - the resource name of the PDML document/resource bundle combination which define the property sheet specification
propertySheetName - the name of the property sheet, as specified on the PROPERTYSHEET tag in the PDML document
dataBeans - a list of DataBeans which supply data to the property sheet (may be null)
owner - the owning frame
Throws: DisplayManagerException
if an error was encountered accessing the panel definition
See Also:
DisplayManagerException, setVisible
 o PropertySheetManager
 public PropertySheetManager(String baseName,
                             Locale locale,
                             String propertySheetName,
                             DataBean dataBeans[],
                             Frame owner) throws DisplayManagerException
Constructs a PropertySheetManager object for the specified property sheet. The property sheet will be modal, with the specified Frame as its owner. The application will block on the call to setVisible until the property sheet has closed.

Parameters:
baseName - the resource name of the PDML document/resource bundle combination which define the property sheet specification
locale - the desired locale to be used to load the property sheet definition
propertySheetName - the name of the property sheet, as specified on the PROPERTYSHEET tag in the PDML
dataBeans - a list of DataBeans which supply data to the property sheet (may be null)
owner - the owning frame
Throws: DisplayManagerException
if an error was encountered accessing the panel definition
See Also:
DisplayManagerException, setVisible
 o PropertySheetManager
 public PropertySheetManager(String baseName,
                             String propertySheetName,
                             DataBean dataBeans[],
                             Container container) throws DisplayManagerException
Constructs a PropertySheetManager for the specified property sheet, using the specified container. This constructor allows the application to supply its own container, rather than relying on this object to create a container of the appropriate type.

The default locale will be used to load the property sheet definition.

Parameters:
baseName - the resource name of the PDML document/resource bundle combination which defines the property sheet specification
panelName - the name of the panel, as specified on the PROPERTYSHEET tag in the PDML
dataBeans - a list of DataBeans which supply data to the property sheet (may be null)
container - the application's container
Throws: DisplayManagerException
if an error was encountered accessing the panel definition
See Also:
DisplayManagerException
 o PropertySheetManager
 public PropertySheetManager(String baseName,
                             Locale locale,
                             String propertySheetName,
                             DataBean dataBeans[],
                             Container container) throws DisplayManagerException
Constructs a PropertySheetManager for the specified property sheet, using the specified container. This constructor allows the application to supply its own container, rather than relying on this object to create a container of the appropriate type.

Parameters:
baseName - the resource name of the PDML document/resource bundle combination which defines the property sheet specification
locale - the desired locale to be used to load the property sheet definition
panelName - the name of the panel, as specified on the PROPERTYSHEET tag in the PDML
dataBeans - a list of DataBeans which supply data to the property sheet (may be null)
container - the application's container
Throws: DisplayManagerException
if an error was encountered accessing the panel definition
See Also:
DisplayManagerException
 o PropertySheetManager
 public PropertySheetManager(String baseName,
                             Locale locale,
                             String propertySheetName) throws DisplayManagerException
Constructs a PropertySheetManager object for the specified property sheet, and then serializes the property sheet definition. This constructor cannot be used to display the property sheet.

If a null locale is specified, the default locale will be used to load the property sheet definition. If resources for the default locale cannot be found, an attempt will be made to use the base resources for the property sheet.

Parameters:
baseName - the resource name of the PDML document/resource bundle combination which define the property sheet specification
locale - the desired locale to be used to load the property sheet definition (may be null)
propertySheetName - the name of the property sheet, as specified on the PROPERTYSHEET tag in the PDML
Throws: DisplayManagerException
if an error was encountered accessing or serializing the panel definition
See Also:
serialize

Methods

 o main
 public static void main(String args[])
Provides a command line interface to PropertySheetManager. See the class description.

 o serialize
 public void serialize() throws IOException
Serializes the property sheet definition. The filename of the serialized file will be of the form
 <property sheet name>_<locale string>.pdml.ser
 
where <property sheet name> is the name of the property sheet as specified on the PROPERTYSHEET tag in the PDML, and <locale string> consists of the ISO Language Code, ISO Country Code, and optional variant codes, each delimited by an underscore ("_") character.

Throws: IOException
if serialized file cannot be written
 o getPage
 public PanelManager getPage(int index)
Returns the PanelManager for the specified property page.

Parameters:
index - the index of the property page
Returns:
the PanelManager instance for the page
 o showPage
 public void showPage(int index)
Shows the Panel for the specified property page.

Parameters:
index - the index of the property page to show
 o setExitOnClose
 public void setExitOnClose(boolean exit)
Controls whether the application exits when the property sheet is closed, based on the value of parameter exit. The default value is false.

This method should be called before the property sheet is made visible.

Parameters:
exit - If true, exit the application; otherwise, just hide the panel.
See Also:
getExitOnClose
 o getExitOnClose
 public boolean getExitOnClose()
Determines whether the application exits when this property sheet is closed.

Returns:
true if the application will be exited; false otherwise.
See Also:
setExitOnClose
 o setTitle
 public void setTitle(String title)
Overrides the property sheet title defined in the property sheet definition.

This method has no effect if the application supplied the container to be managed.

Parameters:
title - The title which should appear in the property sheet's title bar.
See Also:
getTitle
 o setHelpPath
 public void setHelpPath(String path)
 o setVisible
 public void setVisible(boolean show)
Shows or hides the property sheet, depending on the value of parameter show. If an owner frame was specified on the constructor indicating that the property sheet is modal, the application will block on the call to setVisible until the property sheet has closed.

Parameters:
show - If true, shows the property sheet; otherwise, hides the property sheet.
See Also:
isVisible
 o isVisible
 public boolean isVisible()
Determines whether this property sheet is visible. The property sheet is initially invisible.

Returns:
true if the property sheet is visible; false otherwise.
See Also:
setVisible
 o getPreferredSize
 public Dimension getPreferredSize()
Gets the preferred size of this property sheet.

Returns:
A dimension object indicating this property sheet's preferred size.
 o getTitle
 public String getTitle()
Returns the property sheet's title.

Returns null if the application supplied the container to be managed.

Returns:
The title which appears in the property sheet's title bar.
See Also:
PaneManager, setTitle
 o loadData
 public void loadData()
Called during initialization to load data into the panel. This method has no implementation, since PropertySheetManager doesn't participate in aggregates.

See Also:
PaneManager
 o activatePanel
 public void activatePanel()
Runs the activation handlers for the currently selected pane. This method has no implementation, since PropertySheetManager isn't managed as a subpanel.

See Also:
PaneManager
 o showPane
 public void showPane(String paneName)
Displays the specified pane. This method has no implementation, since PropertySheetManager isn't managed as a subpanel.

See Also:
PaneManager
 o getComponent
 public Component getComponent(String componentName)
Returns the requested user interface component. The name of the component must be of the form
<panel_name>.<component_name>
where panel_name is the name of the panel containing the desired component, and component_name is the name of the component, as defined in the PDML for the panel definition.

Parameters:
componentName - the fully-qualified name of the user interface component
Returns:
the desired Component, or null if the component cannot be found
See Also:
PaneManager
 o getComponentDescriptor
 public JavaComponentDescriptor getComponentDescriptor(String componentName)
Returns the JavaComponentDescriptor for the specified user interface component. The name of the component must be of the form
<panel_name>.<component_name>
where panel_name is the name of the panel containing the desired component, and component_name is the name of the component, as defined in the PDML for the panel definition.

Parameters:
componentName - the fully-qualified name of the user interface component
Returns:
the desired JavaComponentDescriptor, or null if the descriptor cannot be found
See Also:
PaneManager
 o getDelegateManager
 public PaneManager getDelegateManager(String paneName)
Returns the PaneManager to which the receiver is delegating management of the specified subpane. This method has no implementation, since PropertySheetManager manages its own panels.

See Also:
PaneManager
 o setAggregateManager
 public void setAggregateManager(PaneManager mgr)
Sets the owning PaneManager for the receiver. This method has no implementation, since PropertySheetManager doesn't participate in aggregates.

See Also:
PaneManager
 o applyChanges
 public void applyChanges()
Transmits changes to user data to the DataBeans which manage the data. This method has no implementation, since PropertySheetManager doesn't participate in aggregates.

See Also:
PaneManager
 o prepareToCommit
 public void prepareToCommit(Vector preparedDataBeans)
Request the DataBeans which manage data for the panel to verify that their data is in a consistent state. This method has no implementation, since PropertySheetManager doesn't participate in aggregates.

See Also:
PaneManager
 o commit
 public void commit(Vector committedDataBeans)
Commits the changes to data displayed on the panel. This method has no implementation, since PropertySheetManager doesn't participate in aggregates.

See Also:
PaneManager
 o setFormatter
 public void setFormatter(String componentName,
                          DataFormatter formatter,
                          boolean required)
Sets the data formatter associated with the specified user interface component. The name of the component must be of the form
<panel_name>.<component_name>
where panel_name is the name of the panel containing the desired component, and component_name is the name of the component, as defined in the PDML for the panel definition.

Parameters:
componentName - the fully-qualified name of the user interface component
formatter - a reference to the data formatter to be associated with the component
required - whether a value is required to be entered
See Also:
DataFormatter
 o getFormatter
 public DataFormatter getFormatter(String componentName)
Returns the data formatter associated with the specified user interface component. The name of the component must be of the form
<panel_name>.<component_name>
where panel_name is the name of the panel containing the desired component, and component_name is the name of the component, as defined in the PDML for the panel definition.

Parameters:
componentName - the fully-qualified name of the user interface component
Returns:
the associated DataFormatter, or null if the component cannot be found
See Also:
DataFormatter
 o getWindow
 public Window getWindow()
Returns the main property sheet window. The window may be either an instance of JDialog or JFrame, depending on whether the property sheet is modal or modeless.

Returns:
the main window for this property sheet
 o setModalRelativeTo
 public void setModalRelativeTo(WindowManager mgr)
Sets the location of the panel being managed relative to a panel managed by the specified WindowManager. If the panel is not currently showing, the panel for this PropertySheetManager is centered on the screen.

This method has no effect if it is called after this property sheet is made visible.

Parameters:
mgr - the WindowManager managing the panel in relation to which this object's panel location is determined
 o addCommitListener
 public void addCommitListener(ActionListener listener)
Adds an ActionListener which is notified when commit processing is complete.

This facility is provided for modeless windows, so that the application may learn when the window has closed. The listener's actionPerformed method will be called following successful completion of commit processing on the property sheet. The ActionEvent passed to the listener object will have its action command string set to "COMMIT".

This method is not recommended for modal windows, since the application will be blocked on the setVisible call until the window is closed.

Parameters:
listener - the ActionListener to be notified
See Also:
WindowManager
 o addCancelListener
 public void addCancelListener(ActionListener listener)
Adds an ActionListener which is notified when the user cancels out of a window.

This facility is provided for modeless windows, so that the application may learn when the window has closed. The listener's actionPerformed method will be called when the user cancels out of the property sheet without committing any changes. The ActionEvent passed to the listener object will have its action command string set to "CANCEL".

This method is not recommended for modal windows, since the application will be blocked on the setVisible call until the window is closed.

Parameters:
listener - the ActionListener to be notified
See Also:
WindowManager

All Packages  Class Hierarchy  This Package  Previous  Next  Index