All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.ibm.as400.ui.framework.java.PanelManager
PanelManager
performs the following processing on behalf
of the application:
DataBean
accessor methods
identified in the PDML.
EventHandler
s
specified in the PDML with the appropriate UI components.
To locate a panel definition, PanelManager
needs three pieces of information:
PANEL
tag in the PDML.
The framework first searches the specified location for a file with a name matching
the panel name, and an extension of .pdml.ser
. If the serialized
panel 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.
MyPanel
is defined in the file TestPanels.pdml
,
and that a properties file TestPanels.properties
is associated with the panel
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 panel and displays it:
import com.ibm.as400.ui.framework.java.*; // Create the panel manager. Parameters: // 1. Resource name of the panel definition // 2. Name of panel // 3. List of DataBeans omitted try { PanelManager pm = new PanelManager("com.ourCompany.ourPackage.TestPanels", "MyPanel", null); } catch (DisplayManagerException e) { e.displayUserMessage(null); System.exit(-1); } // Display the panel pm.setVisible(true);Once the
DataBean
s that supply data to the panel have been
implemented and the attributes have been identified in the PDML,
the following code may be used to construct a fully-functioning dialog:
import com.ibm.as400.ui.framework.java.*; import java.awt.Frame; // Instantiate the objects which supply data to the panel 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 panel manager. Parameters: // 1. Resource name of the panel definition // 2. Name of panel // 3. List of DataBeans // 4. Owner frame window Frame owner; ... try { PanelManager pm = new PanelManager("com.ourCompany.ourPackage.TestPanels", "MyPanel", dataBeans, owner); } catch (DisplayManagerException e) { e.displayUserMessage(null); System.exit(-1); } // Display the panel pm.setVisible(true);
java com.ibm.as400.ui.framework.java.PanelManager [-serialize] [-locale <language code>_<country code>_<variant>] <resource name> <panel name>Options:
.pdml.ser
.
If this option is specified the panel will not be displayed on the screen.
PANEL
tag in the PDML document.
Examples:
java com.ibm.as400.ui.framework.java.PanelManager com.ourCompany.ourPackage.TestPanels MyPanel
java com.ibm.as400.ui.framework.java.PanelManager -serialize com.ourCompany.ourPackage.TestPanels MyPanel
java com.ibm.as400.ui.framework.java.PanelManager -locale en_UK com.ourCompany.ourPackage.TestPanels MyPanel
java com.ibm.as400.ui.framework.java.PanelManager -serialize -locale en_UK com.ourCompany.ourPackage.TestPanels MyPanel
PanelManager
for the specified panel,
and then serializes the panel definition.
PanelManager
for the specified panel.
PanelManager
for the specified panel,
using the specified container.
PanelManager
for the specified panel.
PanelManager
for the specified panel.
PanelManager
for the specified panel,
using the specified container.
PanelManager
for the specified panel.
ActionListener
which is notified when
the user cancels out of a window.
ActionListener
which is notified when
commit processing is complete.
DataBean
s
which manage the data.
JavaComponentDescriptor
for the specified panel component.
DataBean
s that was
specified on this object's constructor.
PaneManager
to which the receiver is delegating
management of the specified subpane.
PanelManager
.
DataBean
s which manage data for the
panel to verify that their data is in a consistent state.
DataBean
.
PaneManager
for the receiver.
exit
.
WindowManager
.
show
.
wait
.
wait
.
public PanelManager(String baseName, String panelName, DataBean dataBeans[]) throws DisplayManagerException
PanelManager
for the specified panel.
The panel will be modeless.
The default locale will be used to load the panel definition.
PANEL
tag in the PDML document
DataBean
s which supply data to the panel (may be null)
public PanelManager(String baseName, Locale locale, String panelName, DataBean dataBeans[]) throws DisplayManagerException
PanelManager
for the specified panel.
The panel will be modeless.
PANEL
tag in the PDML document
DataBean
s which supply data to the panel (may be null)
public PanelManager(String baseName, String panelName, DataBean dataBeans[], Frame owner) throws DisplayManagerException
PanelManager
for the specified panel.
The panel will be modal, with the specified Frame
as its owner.
The application will block on the call to setVisible
until
the panel has closed.
The default locale will be used to load the panel definition.
PANEL
tag in the PDML document
DataBean
s which supply data to the panel (may be null)
public PanelManager(String baseName, Locale locale, String panelName, DataBean dataBeans[], Frame owner) throws DisplayManagerException
PanelManager
for the specified panel.
The panel will be modal, with the specified Frame
as its owner.
The application will block on the call to setVisible
until
the panel has closed.
PANEL
tag in the PDML
DataBean
s which supply data to the panel (may be null)
public PanelManager(String baseName, String panelName, DataBean dataBeans[], Container container) throws DisplayManagerException
PanelManager
for the specified panel,
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 panel definition.
PANEL
tag in the PDML
DataBean
s which supply data to the panel (may be null)
public PanelManager(String baseName, Locale locale, String panelName, DataBean dataBeans[], Container container) throws DisplayManagerException
PanelManager
for the specified panel,
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.
PANEL
tag in the PDML
DataBean
s which supply data to the panel (may be null)
public PanelManager(String baseName, Locale locale, String panelName) throws DisplayManagerException
PanelManager
for the specified panel,
and then serializes the panel definition.
This constructor cannot be used to display the panel.
If a null locale is specified, the default locale will be used to load the panel definition. If resources for the default locale cannot be found, an attempt will be made to use the base resources for the panel.
PANEL
tag in the PDML
public static void main(String args[])
PanelManager
. See the class description.
public void serialize() throws IOException
<panel name>_<locale string>.pdml.serwhere
<panel name>
is the name of the panel as specified on the PANEL
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.
public void setExitOnClose(boolean exit)
exit
.
The default value is false
.
This method has no effect if it is called after this panel is made visible, or if the application supplied the container to be managed.
public boolean getExitOnClose()
public void setTitle(String title)
This method has no effect if the application supplied the ??
public void setHelpPath(String path)
public void setVisible(boolean show)
show
.
If an owner frame was specified on the constructor indicating that the
panel is modal, the application will block on the call to setVisible
until the panel has closed.
This method has no effect if the application supplied the container to be managed.
public boolean isVisible()
public DataBean[] getDataBeans()
DataBean
s that was
specified on this object's constructor.
Vector
of DataBean
s
public Container getContainer()
Container
object supplied on this object's constructor will
be returned, if one was specified. Otherwise, this method
will return the content pane of a JDialog
or
JFrame
object, depending on whether the panel
is modal or modeless.
public Dimension getPreferredSize()
public void refreshComponent(String componentName)
DataBean
.
public void setWaitCursor(boolean wait)
wait
.
If wait
is true
, the hourglass cursor will
appear over the panel and all its components.
Calling setWaitCursor
with a value of false
will restore the normal "default" cursor.
public void setWaitPending(boolean wait)
wait
.
If wait
is true
, the panel and all its
user-modifiable components will be grayed out and disabled for user input,
and the hourglass cursor will be displayed.
Calling setWaitPending
with a value of false
will restore the panel components to their normal "enabled" state,
and restore the normal cursor.
public String toString()
public void setFormatter(String componentName, DataFormatter formatter, boolean required)
This facility is provided formatters which require specialized parameters or initialization beyond the standard inititialization offered during run time. The panel manager uses the formatter provided instead of creating a formatter at run time.
public DataFormatter getFormatter(String componentName)
DataFormatter
or null if not set or not found true if the formatter was successfully set
public String getTitle()
Returns null if the application supplied the container to be managed.
public void loadData()
public void activatePanel()
setVisible
if they supplied their own container on the constructor.
public void showPane(String paneName)
PanelManager
's single
pane is always visible.
public Component getComponent(String name)
Component
having the name specified
public JavaComponentDescriptor getComponentDescriptor(String name)
JavaComponentDescriptor
for the specified panel component.
JavaComponentDescriptor
for the component
public PaneManager getDelegateManager(String paneName)
PaneManager
to which the receiver is delegating
management of the specified subpane.
PaneManager
, or null
if the object cannot be found
public void setAggregateManager(PaneManager mgr)
PaneManager
for the receiver.
The specified object identifies the PaneManager
to which certain requests should be delegated when this PanelManager
is participating in an aggregate user interface.
PaneManager
with which the receiver is to be associated
public void applyChanges() throws IllegalUserDataException
DataBean
s
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 panel is about to be closed.
public void prepareToCommit(Vector preparedDataBeans)
DataBean
s which manage data for the
panel to verify that their data is in a consistent state.
Calls the verifyChanges
method for all DataBean
s
associated with the panel.
This method is called when the panel is about to be closed.
DataBean
s which have already
been prepared on the current commit operation
public void commit(Vector committedDataBeans)
commit
method on all DataBean
s
which manage data for the panel.
This method is called when the user indicates a desire to permanently save changes to the data, by clicking an OK button for example.
DataBean
s which have already
been saved on the current commit operation
public Window getWindow()
public void setModalRelativeTo(WindowManager mgr)
WindowManager
.
If the panel is not currently showing, the panel for this
PanelManager
is centered on the screen.
This method has no effect if it is called after this panel is made visible.
WindowManager
managing the panel
in relation to which this object's panel location is determined
public void addCommitListener(ActionListener listener)
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 panel.
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.
ActionListener
to be notified
public void addCancelListener(ActionListener listener)
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 panel 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.
ActionListener
to be notified
All Packages Class Hierarchy This Package Previous Next Index