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

java.lang.Object
  |
  +--com.ibm.as400.ui.framework.java.TabbedPaneManager
All Implemented Interfaces:
PaneManager

public class TabbedPaneManager
extends java.lang.Object
implements PaneManager

Creates a subpanel containing a group of windows which lets the user switch between windows by clicking on a tab. Each window consists of a panel defined using the Panel Definition Markup Language (PDML).

TabbedPaneManager does not implement the WindowManager interface, and thus cannot be used to create a standalone window or dialog. It is designed to be incorporated in the definition of an existing panel, property sheet or wizard. Applications normally do not construct TabbedPaneManagers directly. Instead, a reference to the TabbedPaneManager for a particular subpanel is obtained by calling getDelegateManager on the PaneManager for the containing panel.

TabbedPaneManager performs the following processing on behalf of the application:

The total size of the tabbed pane is a function of the size of the largest panel.

Since:
v4r2m0
See Also:
PaneManager.getDelegateManager(java.lang.String), PanelManager

Constructor Summary
TabbedPaneManager(java.lang.String baseName, java.util.Locale locale, java.lang.String tabbedPaneName)
          Constructs a TabbedPaneManager object for the specified tabbed pane, and then serializes the tabbed pane definition.
TabbedPaneManager(java.lang.String baseName, java.util.Locale locale, java.lang.String tabbedPaneName, DataBean[] dataBeans, java.awt.Container container)
          Constructs a TabbedPaneManager for the specified tabbed pane, using the specified container.
TabbedPaneManager(java.lang.String baseName, java.lang.String tabbedPaneName, DataBean[] dataBeans, java.awt.Container container)
          Constructs a TabbedPaneManager for the specified tabbed pane, using the specified container.
 
Method Summary
 void activatePanel()
          Runs the activation handlers for the currently selected pane.
 void addPane(PanelManager pm, int index)
          Adds a panel to the tabbed pane.
 void applyChanges()
          Transmits changes to user data to the DataBeans which manage the data.
 void commit(java.util.Vector committedDataBeans)
          Commits the changes to data displayed on the pane.
 PaneManager getAggregateManager()
          Returns the owning PaneManager for the receiver.
 java.awt.Component getComponent(java.lang.String componentName)
          Returns the requested user interface component.
 com.ibm.as400.ui.framework.java.JavaComponentDescriptor getComponentDescriptor(java.lang.String componentName)
          Returns the JavaComponentDescriptor for the specified user interface component.
 PaneManager getDelegateManager(java.lang.String paneName)
          Returns the PaneManager to which the receiver is delegating management of the specified subpane.
 DataFormatter getFormatter(java.lang.String componentName)
          Returns the data formatter associated with the specified user interface component.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of this tabbed pane.
 PaneManager getRootManager()
          Returns the root PaneManager for the receiver.
 javax.swing.JTabbedPane getTabbedPane()
          Gets the tabbed pane object of this tabbed pane.
 java.lang.String getTitle()
          Returns the tabbed pane's title.
 void loadData()
          Called during initialization to load data into the pane.
static void main(java.lang.String[] args)
          Provides a command line interface to TabbedPaneManager.
 void prepareToCommit(java.util.Vector preparedDataBeans)
          Request the DataBeans which manage data for the panel to verify that their data is in a consistent state.
 void removePane(int index)
          Removes a panel from the Tabbed Pane.
 void removePane(java.lang.String name)
          Removes a panel from the Tabbed Pane.
 void serialize()
          Serializes the tabbed pane definition.
 void setAggregateManager(PaneManager mgr)
          Sets the owning PaneManager for the receiver.
 void setFormatter(java.lang.String componentName, DataFormatter formatter, boolean required)
          Sets the data formatter associated with the specified user interface component.
 void setHelpPath(java.lang.String path)
          Base location for help files.
 void showPane(java.lang.String paneName)
          Displays the specified tab.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabbedPaneManager

public TabbedPaneManager(java.lang.String baseName,
                         java.lang.String tabbedPaneName,
                         DataBean[] dataBeans,
                         java.awt.Container container)
                  throws DisplayManagerException
Constructs a TabbedPaneManager for the specified tabbed pane, using the specified container.

The default locale will be used to load the tabbed pane definition.

Parameters:
baseName - the resource name of the PDML document/resource bundle combination which defines the tabbed pane specification
paneName - the name of the tabbed pane, as specified on the TABBEDPANE tag in the PDML
dataBeans - a list of DataBeans which supply data to the tabbed pane (may be null)
container - the caller's container
Throws:
DisplayManagerException - if an error was encountered accessing the tabbed pane definition
Since:
v4r2m0
See Also:
DisplayManagerException

TabbedPaneManager

public TabbedPaneManager(java.lang.String baseName,
                         java.util.Locale locale,
                         java.lang.String tabbedPaneName,
                         DataBean[] dataBeans,
                         java.awt.Container container)
                  throws DisplayManagerException
Constructs a TabbedPaneManager for the specified tabbed pane, using the specified container.
Parameters:
baseName - the resource name of the PDML document/resource bundle combination which defines the tabbed pane specification
locale - the desired locale to be used to load the tabbed pane definition
tabbedPaneName - the name of the tabbed pane, as specified on the TABBEDPANE tag in the PDML
dataBeans - a list of DataBeans which supply data to the tabbed pane (may be null)
container - the caller's container
Throws:
DisplayManagerException - if an error was encountered accessing the tabbed pane definition
Since:
v4r2m0
See Also:
DisplayManagerException

TabbedPaneManager

public TabbedPaneManager(java.lang.String baseName,
                         java.util.Locale locale,
                         java.lang.String tabbedPaneName)
                  throws DisplayManagerException
Constructs a TabbedPaneManager object for the specified tabbed pane, and then serializes the tabbed pane definition. This constructor cannot be used to display the tabbed pane.

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

Parameters:
baseName - the resource name of the PDML document/resource bundle combination which define the tabbed pane specification
locale - the desired locale to be used to load the tabbed pane definition (may be null)
tabbedPaneName - the name of the tabbed pane, as specified on the TABBEDPANE tag in the PDML
Throws:
DisplayManagerException - if an error was encountered accessing or serializing the tabbed pane definition
Since:
v4r2m0
See Also:
serialize()
Method Detail

main

public static void main(java.lang.String[] args)
Provides a command line interface to TabbedPaneManager. See the class description.
Since:
v4r2m0

serialize

public void serialize()
               throws java.io.IOException
Serializes the tabbed pane definition. The filename of the serialized file will be of the form
 <tabbed pane name>_<locale string>.pdml.ser
 
where <tabbed pane name> is the name of the tabbed pane as specified on the TABBEDPANE 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:
java.io.IOException - if serialized file cannot be written
Since:
v4r2m0

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of this tabbed pane.
Returns:
A dimension object indicating this tabbed pane's preferred size.
Since:
v4r2m0

getTabbedPane

public javax.swing.JTabbedPane getTabbedPane()
Gets the tabbed pane object of this tabbed pane.
Returns:
An instance of JTabbedPane.
Since:
v5r1m0

getTitle

public java.lang.String getTitle()
Returns the tabbed pane's title.
Specified by:
getTitle in interface PaneManager
Returns:
the title specified in the PDML definition for the tabbed pane
Since:
v4r2m0

loadData

public void loadData()
Called during initialization to load data into the pane.
Specified by:
loadData in interface PaneManager
Since:
v4r2m0
See Also:
PaneManager

activatePanel

public void activatePanel()
Runs the activation handlers for the currently selected pane.
Specified by:
activatePanel in interface PaneManager
Since:
v4r2m0
See Also:
PaneManager

showPane

public void showPane(java.lang.String paneName)
Displays the specified tab.
Specified by:
showPane in interface PaneManager
Parameters:
paneName - the name of the pane to be displayed
Since:
v4r2m0
See Also:
PaneManager

getComponent

public java.awt.Component getComponent(java.lang.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.
Specified by:
getComponent in interface PaneManager
Parameters:
componentName - the fully-qualified name of the user interface component
Returns:
the desired Component, or null if the component cannot be found
Since:
v4r2m0
See Also:
PaneManager

getComponentDescriptor

public com.ibm.as400.ui.framework.java.JavaComponentDescriptor getComponentDescriptor(java.lang.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.
Specified by:
getComponentDescriptor in interface PaneManager
Parameters:
componentName - the fully-qualified name of the user interface component
Returns:
the desired JavaComponentDescriptor, or null if the descriptor cannot be found
Since:
v4r2m0
See Also:
PaneManager

getDelegateManager

public PaneManager getDelegateManager(java.lang.String paneName)
Returns the PaneManager to which the receiver is delegating management of the specified subpane.
Specified by:
getDelegateManager in interface PaneManager
Parameters:
paneName - the name of the pane as specified in the PDML definition
Returns:
the desired PaneManager, or null if the object cannot be found
Since:
v4r2m0
See Also:
PaneManager

setAggregateManager

public void setAggregateManager(PaneManager mgr)
Sets the owning PaneManager for the receiver. The specified object identifies the PaneManager to which certain requests should be delegated when this TabbedPaneManager is participating in an aggregate user interface.
Specified by:
setAggregateManager in interface PaneManager
Parameters:
mgr - the PaneManager with which the receiver is to be associated
Since:
v4r2m0
See Also:
PaneManager

getAggregateManager

public PaneManager getAggregateManager()
Returns the owning PaneManager for the receiver.
Specified by:
getAggregateManager in interface PaneManager
Returns:
the PaneManager with which the receiver is associated when this object is participating in an aggregate user interface, or null if this PaneManager is not part of an aggregate.
Since:
v4r5m0
See Also:
PaneManager

getRootManager

public PaneManager getRootManager()
Returns the root PaneManager for the receiver.
Specified by:
getRootManager in interface PaneManager
Returns:
the PaneManager for the main panel that is managing the aggregate user interface, or null if this PaneManager is not part of an aggregate.
Since:
v4r5m0
See Also:
PaneManager

applyChanges

public void applyChanges()
                  throws IllegalUserDataException
Transmits changes to user data to the DataBeans which manage the data. Calls the settor methods for all UI components that have accessor methods associated with them.

This method is called when the pane is about to be closed.

Specified by:
applyChanges in interface PaneManager
Since:
v4r2m0
See Also:
PaneManager

prepareToCommit

public void prepareToCommit(java.util.Vector preparedDataBeans)
Request the DataBeans which manage data for the panel to verify that their data is in a consistent state. Calls the verifyChanges method for all DataBeans associated with the pane.

This method is called when the pane is about to be closed.

Specified by:
prepareToCommit in interface PaneManager
Parameters:
preparedDataBeans - a list of DataBeans which have already been prepared on the current commit operation
Since:
v4r2m0
See Also:
PaneManager

commit

public void commit(java.util.Vector committedDataBeans)
Commits the changes to data displayed on the pane. Calls the commit method on all DataBeans which manage data for the pane.

This method is called when the user indicates a desire to permanently save changes to the data, by clicking an OK button for example.

Specified by:
commit in interface PaneManager
Parameters:
committedDataBeans - a list of DataBeans which have already been saved on the current commit operation
Since:
v4r2m0
See Also:
PaneManager

setFormatter

public void setFormatter(java.lang.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.
Specified by:
setFormatter in interface PaneManager
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
Since:
v4r2m0
See Also:
DataFormatter

getFormatter

public DataFormatter getFormatter(java.lang.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.
Specified by:
getFormatter in interface PaneManager
Parameters:
componentName - the fully-qualified name of the user interface component
Returns:
the associated DataFormatter, or null if the component cannot be found
Since:
v4r2m0
See Also:
DataFormatter

setHelpPath

public void setHelpPath(java.lang.String path)
Description copied from interface: PaneManager
Base location for help files. For use in the no-plugin applet case. For example for MyPanel, setHelpPath("http://www.ibm.com/help/") will cause the PanelManager to load http://www.ibm.com/help/MyPanel.html as the help file.
Specified by:
setHelpPath in interface PaneManager

addPane

public void addPane(PanelManager pm,
                    int index)
Adds a panel to the tabbed pane.
Parameters:
pm - the PanelManager for the new panel
index - the position at which the new page will be inserted
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the value of the specified index exceeds the current page count
Since:
v5r1m0

removePane

public void removePane(java.lang.String name)
Removes a panel from the Tabbed Pane.
Parameters:
name - the name of the panel as specified in the PDML
Since:
v5r1m0

removePane

public void removePane(int index)
Removes a panel from the Tabbed Pane.
Parameters:
index - the index of the panel to be removed
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the value of the specified index exceeds the current page count minus 1
Since:
v5r1m0