|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.ui.framework.java.PanelManager
Creates a graphical panel defined using the Panel Definition Markup Language (PDML). The panel may be either a standalone window or a modal dialog.
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 PanelManager pm = null; try { 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; ... PanelManager pm = null; try { 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
DisplayManagerException
Field Summary | |
protected int |
m_windowMinHeight
|
protected int |
m_windowMinWidth
|
Fields inherited from interface com.ibm.as400.ui.framework.java.WindowManager |
OFFSET_FROM_OWNER |
Constructor Summary | |
PanelManager(java.lang.String baseName,
java.util.Locale locale,
java.lang.String panelName)
Constructs a PanelManager for the specified panel,
and then serializes the panel definition. |
|
PanelManager(java.lang.String baseName,
java.util.Locale locale,
java.lang.String panelName,
DataBean[] dataBeans)
Constructs a PanelManager for the specified panel. |
|
PanelManager(java.lang.String baseName,
java.util.Locale locale,
java.lang.String panelName,
DataBean[] dataBeans,
java.awt.Container container)
Constructs a PanelManager for the specified panel,
using the specified container. |
|
PanelManager(java.lang.String baseName,
java.util.Locale locale,
java.lang.String panelName,
DataBean[] dataBeans,
java.awt.Frame owner)
Constructs a PanelManager for the specified panel. |
|
PanelManager(java.lang.String baseName,
java.lang.String panelName,
DataBean[] dataBeans)
Constructs a PanelManager for the specified panel. |
|
PanelManager(java.lang.String baseName,
java.lang.String panelName,
DataBean[] dataBeans,
java.awt.Container container)
Constructs a PanelManager for the specified panel,
using the specified container. |
|
PanelManager(java.lang.String baseName,
java.lang.String panelName,
DataBean[] dataBeans,
java.awt.Frame owner)
Constructs a PanelManager for the specified panel. |
Method Summary | |
void |
activatePanel()
Runs the activation handlers for this panel. |
void |
addActionListener(java.lang.String componentName,
java.awt.event.ActionListener al)
Adds an ActionListener to the component identified by componentName
These listeners will not be notified when DataBean updating occurs through calls
to loadData() or refreshComponent(). |
void |
addActivationHandler(EventHandler eh)
Adds an ActionListener which is notified when
this panel is shown
|
void |
addCancelListener(java.awt.event.ActionListener listener)
Adds an ActionListener which is notified when
the user cancels out of a window. |
void |
addCancelListener(java.lang.Object listener)
|
void |
addCommitListener(java.awt.event.ActionListener listener)
Adds an ActionListener which is notified when
commit processing is complete. |
void |
addCommitListener(java.lang.Object listener)
|
void |
addExpansionListener(java.lang.String treeTableName,
java.lang.Object listener)
Adds a TreeExpansionListener which is notified when
the user expands a node in the specified tree table. |
void |
addHelpListener(HelpListener listener)
Identifies an alternate help system. |
void |
applyChanges()
Transmits changes to user data to the DataBean s
which manage the data. |
void |
applyChanges(java.lang.String componentName)
Transmits changes to user data to the DataBean s
which manage the data. |
void |
commit(java.util.Vector committedDataBeans)
Commits the changes to data displayed on the panel. |
void |
displayHelp()
Displays the overview help for the panel. |
void |
dispose()
Closes the panel and releases all resources used by the panel and its associated UI components. |
PaneManager |
getAggregateManager()
Returns the owning PaneManager for the receiver. |
java.awt.Component |
getComponent(java.lang.String name)
Returns the panel component identified by name. |
com.ibm.as400.ui.framework.java.JavaComponentDescriptor |
getComponentDescriptor(java.lang.String name)
Returns the JavaComponentDescriptor for the specified panel component. |
java.lang.String |
getComponentText(java.lang.String componentName)
Convenience method which gets the component's text |
java.awt.Container |
getContainer()
Returns the container which holds the user interface components for the panel. |
DataBean[] |
getDataBeans()
Returns the list of DataBean s that was
specified on this object's constructor. |
PaneManager |
getDelegateManager(java.lang.String paneName)
Returns the PaneManager to which the receiver is delegating
management of the specified subpane. |
boolean |
getExitOnClose()
Determines whether the application exits when this panel is closed. |
DataFormatter |
getFormatter(java.lang.String componentName)
Returns any specialized formatter to be used for a component. |
java.lang.String |
getIconName()
Returns the name of the icon used for this panel. |
javax.swing.JMenuBar |
getMenuBar()
Returns the menu bar defined for this panel. |
MenuManager |
getMenuManager(java.lang.String name)
Returns a MenuManager associated with this panel's menu bar. |
java.lang.String |
getName()
Gets this PanelManager's name |
NodeDescriptor |
getNode(java.lang.String treeTableName,
int row)
Returns the tree node in the specified table row |
WindowManager |
getOwnerManager()
Returns the WindowManager in relation to which
the receiver has been set modal, or null if the receiver is not
modal relative to another window. |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of this panel. |
PaneManager |
getRootManager()
Returns the root PaneManager for the receiver. |
boolean |
getSaveOnThread()
Indicates whether calls to the save method
on the application's DataBean objects will
be called on a non-UI thread. |
int |
getTableRow(java.lang.String treeTableName,
NodeDescriptor nd)
Returns the table row number containing the specified tree node |
java.lang.String |
getTitle()
Returns the panel's title. |
javax.swing.JToolBar |
getToolBar()
Returns the toolbar defined for this panel. |
javax.swing.AbstractButton |
getToolBarButton(java.lang.String name)
Returns a JComponent from the ToolBar |
java.awt.Window |
getWindow()
Returns the main panel window. |
void |
handleDataException(IllegalUserDataException ex)
Provides the default handling for an IllegalUserDataException . |
static void |
handleDataException(IllegalUserDataException ex,
java.awt.Container messageOwner)
Provides the default handling for an IllegalUserDataException . |
boolean |
isEnabled(java.lang.String name)
Determines whether the panel component identified by name is Enabled. |
boolean |
isRequiredField(java.lang.String componentName)
Returns whether this entry-field requires a non-blank entry |
boolean |
isVisible()
Determines whether this panel is visible. |
boolean |
isVisible(java.lang.String name)
Determines whether the panel component identified by name is Enabled. |
void |
loadData()
Called during initialization to load data into the panel. |
static void |
main(java.lang.String[] args)
Provides a command line interface to PanelManager . |
void |
prepareToCommit(java.util.Vector preparedDataBeans)
Request the DataBean s which manage data for the
panel to verify that their data is in a consistent state. |
void |
refreshComponent(java.lang.String componentName)
Reloads a UI component with updated data from the component's DataBean . |
void |
refreshTree(java.lang.String treeName)
Reloads a tree component with updated data from the tree's DataBean ,
while preserving the expansion state of all visible nodes
Warning: NodeDescriptors in the tree must have unique names. |
void |
removeActionListener(java.lang.String componentName,
java.awt.event.ActionListener al)
Removes an ActionListener from the component identified by componentName |
void |
removeExpansionListener(java.lang.Object listener)
Removes a TreeExpansionListener from the 'active list'
|
void |
serialize()
Serializes the panel definition. |
void |
setAggregateManager(PaneManager mgr)
Sets the owning PaneManager for the receiver. |
void |
setButtonText(java.lang.String buttonName,
java.lang.String text)
Sets the button's text |
void |
setComponentText(java.lang.String componentName,
java.lang.String text)
Convenience method which sets the component's text |
void |
setEnabled(java.lang.String name,
boolean b)
Enables the panel component identified by name. |
void |
setExitOnClose(boolean exit)
Controls whether the application exits when the panel is closed, based on the value of parameter exit . |
void |
setExpanded(java.lang.String treeTableName,
NodeDescriptor nd,
boolean bExpand)
Programmatically expand or collapse a node in a tree component |
void |
setFormatter(java.lang.String componentName,
DataFormatter formatter,
boolean required)
Sets a pre-created formatter to be used for a component. |
void |
setHelpPath(java.lang.String path)
Base location for help files. |
void |
setIconName(java.lang.String fileName)
Overrides the name of the icon to use for this panel. |
void |
setModalRelativeTo(WindowManager mgr)
Sets the location of the panel being managed relative to a panel managed by the specified WindowManager . |
void |
setName(java.lang.String name)
Sets the name of this PanelManager This method should only be used for PanelManagers that will be added to PropertySheets or Wizards and must be called before they are added |
void |
setRequiredField(java.lang.String componentName,
boolean required)
Sets whether this field should be required |
void |
setSaveOnThread(boolean saveOnThread)
Controls whether calls to the save method
on the application's DataBean objects will
be called on a non-UI thread. |
void |
setTitle(java.lang.String title)
Overrides the panel title defined in the panel definition. |
void |
setToolBarIcon(javax.swing.ImageIcon icon)
Sets the Icon to be displayed right justified on the toolbar |
void |
setVisible(boolean show)
Shows or hides the panel, depending on the value of parameter show . |
void |
setVisible(java.lang.String name,
boolean b)
Shows or hides the panel component identified by name. |
void |
setWaitCursor(boolean wait)
Sets or clears the wait cursor for the entire panel, based on the value of parameter wait . |
void |
setWaitPending(boolean wait)
Enables or disables the entire panel, based on the value of parameter wait . |
void |
showPane(java.lang.String paneName)
Displays the specified pane. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int m_windowMinWidth
protected int m_windowMinHeight
Constructor Detail |
public PanelManager(java.lang.String baseName, java.lang.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.
baseName
- the resource name of the PDML document/resource bundle combination which defines the panel specificationpanelName
- the name of the panel, as specified on the PANEL
tag in the PDML documentdataBeans
- a list of DataBean
s which supply data to the panel (may be null)DisplayManagerException
- if an error was encountered accessing the panel definitionDisplayManagerException
public PanelManager(java.lang.String baseName, java.util.Locale locale, java.lang.String panelName, DataBean[] dataBeans) throws DisplayManagerException
PanelManager
for the specified panel.
The panel will be modeless.baseName
- the resource name of the PDML document/resource bundle combination which defines the panel specificationlocale
- the desired locale to be used to load the panel definitionpanelName
- the name of the panel, as specified on the PANEL
tag in the PDML documentdataBeans
- a list of DataBean
s which supply data to the panel (may be null)DisplayManagerException
- if an error was encountered accessing the panel definitionDisplayManagerException
public PanelManager(java.lang.String baseName, java.lang.String panelName, DataBean[] dataBeans, java.awt.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.
baseName
- the resource name of the PDML document/resource bundle combination which defines the panel specificationpanelName
- the name of the panel, as specified on the PANEL
tag in the PDML documentdataBeans
- a list of DataBean
s which supply data to the panel (may be null)owner
- the owning frameDisplayManagerException
- if an error was encountered accessing the panel definitionDisplayManagerException
,
setVisible(boolean)
public PanelManager(java.lang.String baseName, java.util.Locale locale, java.lang.String panelName, DataBean[] dataBeans, java.awt.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.baseName
- the resource name of the PDML document/resource bundle combination which defines the panel specificationlocale
- the desired locale to be used to load the panel definitionpanelName
- the name of the panel, as specified on the PANEL
tag in the PDMLdataBeans
- a list of DataBean
s which supply data to the panel (may be null)owner
- the owning frameDisplayManagerException
- if an error was encountered accessing the panel definitionDisplayManagerException
,
setVisible(boolean)
public PanelManager(java.lang.String baseName, java.lang.String panelName, DataBean[] dataBeans, java.awt.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.
baseName
- the resource name of the PDML document/resource bundle combination which defines the panel specificationpanelName
- the name of the panel, as specified on the PANEL
tag in the PDMLdataBeans
- a list of DataBean
s which supply data to the panel (may be null)container
- the application's containerDisplayManagerException
- if an error was encountered accessing the panel definitionDisplayManagerException
public PanelManager(java.lang.String baseName, java.util.Locale locale, java.lang.String panelName, DataBean[] dataBeans, java.awt.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.baseName
- the resource name of the PDML document/resource bundle combination which defines the panel specificationlocale
- the desired locale to be used to load the panel definitionpanelName
- the name of the panel, as specified on the PANEL
tag in the PDMLdataBeans
- a list of DataBean
s which supply data to the panel (may be null)container
- the application's containerDisplayManagerException
- if an error was encountered accessing the panel definitionDisplayManagerException
public PanelManager(java.lang.String baseName, java.util.Locale locale, java.lang.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.
baseName
- the resource name of the PDML document/resource bundle combination which defines the panel specificationlocale
- the desired locale to be used to load the panel definition (may be null)panelName
- the name of the panel, as specified on the PANEL
tag in the PDMLDisplayManagerException
- if an error was encountered accessing or serializing the panel definitionserialize()
Method Detail |
public static void main(java.lang.String[] args)
PanelManager
. See the class description.public void serialize() throws java.io.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.java.io.IOException
- if serialized file cannot be writtenpublic 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.
exit
- If true, exit the application; otherwise, just hide the panel.getExitOnClose()
public boolean getExitOnClose()
setExitOnClose(boolean)
public void setTitle(java.lang.String title)
This method has no effect if the application supplied the container to be managed.
title
- The title which should appear in the panel's title bar.getTitle()
public void setIconName(java.lang.String fileName)
setVisible(true)
and only sets the icon for
modeless windows.fileName
- The filename of the icon to search for in the classpath.getIconName()
public java.lang.String getIconName()
getIconName()
public void setHelpPath(java.lang.String path)
PaneManager
setHelpPath("http://www.ibm.com/help/")
will
cause the PanelManager to load http://www.ibm.com/help/MyPanel.html as
the help file.setHelpPath
in interface PaneManager
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.
setVisible
in interface WindowManager
show
- If true, shows the panel; otherwise, hides the panel.isVisible()
,
WindowManager
public boolean isVisible()
isVisible
in interface WindowManager
setVisible(boolean)
,
WindowManager
public DataBean[] getDataBeans()
DataBean
s that was
specified on this object's constructor.Vector
of DataBean
spublic java.awt.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 void addActivationHandler(EventHandler eh)
ActionListener
which is notified when
this panel is shown
The ActionEvent
passed to the listener object will
have its action command string set to "Activated".
eh
- the instance of java.awt.event.ActionListener
to be notifiedEventHandler
public java.awt.Dimension getPreferredSize()
public void refreshComponent(java.lang.String componentName)
DataBean
.componentName
- the name of the component whose data is to be refreshed,
as specified in the PDML definition for the panelpublic void refreshTree(java.lang.String treeName)
DataBean
,
while preserving the expansion state of all visible nodes
Warning: NodeDescriptors in the tree must have unique names.treeName
- the name of the tree whose data is to be refreshed,
as specified in the PDML definition for the panelpublic 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.wait
- If true, sets the wait cursor; otherwise, restores the default cursor.setWaitPending(boolean)
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.enable
- If true, enables the panel; otherwise, disables the panel.setWaitCursor(boolean)
public java.lang.String toString()
toString
in class java.lang.Object
public void setFormatter(java.lang.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.
setFormatter
in interface PaneManager
componentName
- the name of the component as specified in the panel definitionformatter
- a DataFormatter subclassed objectrequired
- a value is required for this componentDataFormatter
public DataFormatter getFormatter(java.lang.String componentName)
getFormatter
in interface PaneManager
componentName
- the name of the component as specified in the panel definitionDataFormatter
or null if not set or not found true if the formatter was successfully setDataFormatter
public void setRequiredField(java.lang.String componentName, boolean required)
componentName
- the name of the component as specified in the panel definitionrequired
- whether this field should be requiredjava.lang.IllegalArgumentException
- if no formatter is specified for this fieldDataFormatter
public boolean isRequiredField(java.lang.String componentName)
componentName
- the name of the component as specified in the panel definitionjava.lang.IllegalArgumentException
- if no formatter is specified for this fieldDataFormatter
public void setButtonText(java.lang.String buttonName, java.lang.String text)
buttonName
- the name of the button as specified in the panel definitiontext
- The text to display on the buttonjava.lang.IllegalArgumentException
- if there isn't a button named buttonNameDataFormatter
public void setComponentText(java.lang.String componentName, java.lang.String text)
componentName
- the name of the component as specified in the panel definitiontext
- The text to display on the componentjava.lang.IllegalArgumentException
- if there isn't a component named componentNamejava.lang.IllegalArgumentException
- if the component doesn't have a way to set textpublic java.lang.String getComponentText(java.lang.String componentName)
componentName
- the name of the component as specified in the panel definitionjava.lang.IllegalArgumentException
- if there isn't a component named componentNamejava.lang.IllegalArgumentException
- if the component doesn't have a way to get textpublic MenuManager getMenuManager(java.lang.String name)
name
- the name of the menu as specified in the panel definitionMenuManager
or null if not foundMenuManager
public java.lang.String getTitle()
Returns null if the application supplied the container to be managed.
getTitle
in interface PaneManager
PaneManager
,
setTitle(java.lang.String)
public void loadData()
loadData
in interface PaneManager
PaneManager
public void activatePanel()
setVisible
if they supplied their own container on the constructor.activatePanel
in interface PaneManager
setVisible(boolean)
,
PaneManager
public void showPane(java.lang.String paneName)
PanelManager
's single
pane is always visible.showPane
in interface PaneManager
PaneManager
public java.awt.Component getComponent(java.lang.String name)
getComponent
in interface PaneManager
name
- the name of the component as specified in the panel definitionComponent
having the name specifiedPaneManager
public void setEnabled(java.lang.String name, boolean b)
name
- the name of the component as specified in the panel definitionb
- If true, this component is enabled; otherwise this component is disabled.public boolean isEnabled(java.lang.String name)
name
- the name of the component as specified in the panel definitionpublic void setVisible(java.lang.String name, boolean b)
name
- the name of the component as specified in the panel definitionb
- If true, this component is shown; otherwise this component is hidden.public boolean isVisible(java.lang.String name)
name
- the name of the component as specified in the panel definitionpublic com.ibm.as400.ui.framework.java.JavaComponentDescriptor getComponentDescriptor(java.lang.String name)
JavaComponentDescriptor
for the specified panel component.getComponentDescriptor
in interface PaneManager
name
- the name of the component as specified in the panel definitionJavaComponentDescriptor
for the componentPaneManager
public PaneManager getDelegateManager(java.lang.String paneName)
PaneManager
to which the receiver is delegating
management of the specified subpane.getDelegateManager
in interface PaneManager
paneName
- the name of the pane as specified in the PDML definitionPaneManager
, or null
if the object cannot be foundPaneManager
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.setAggregateManager
in interface PaneManager
mgr
- the PaneManager
with which the receiver is to be associatedPaneManager
public PaneManager getAggregateManager()
PaneManager
for the receiver.getAggregateManager
in interface PaneManager
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.PaneManager
public PaneManager getRootManager()
PaneManager
for the receiver.getRootManager
in interface PaneManager
PaneManager
for the main panel that is
managing the aggregate user interface, or null if this PaneManager
is not part of an aggregate.PaneManager
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.
applyChanges
in interface PaneManager
PaneManager
public void applyChanges(java.lang.String componentName) throws IllegalUserDataException
DataBean
s
which manage the data.
Calls the settor methods for the UI component identified by name.
componentName
- The name of the component to write changes for.applyChanges()
public void prepareToCommit(java.util.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.
prepareToCommit
in interface PaneManager
preparedDataBeans
- a list of DataBean
s which have already
been prepared on the current commit operationPaneManager
public void commit(java.util.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.
commit
in interface PaneManager
committedDataBeans
- a list of DataBean
s which have already
been saved on the current commit operationPaneManager
public java.awt.Window getWindow()
getWindow
in interface WindowManager
WindowManager
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.
setModalRelativeTo
in interface WindowManager
mgr
- the WindowManager
managing the panel
in relation to which this object's panel location is determinedWindowManager
public WindowManager getOwnerManager()
WindowManager
in relation to which
the receiver has been set modal, or null if the receiver is not
modal relative to another window.getOwnerManager
in interface WindowManager
WindowManager
managing the window
in relation to which this object's window location is determinedWindowManager
public int getTableRow(java.lang.String treeTableName, NodeDescriptor nd)
treeTableName
- the attribute name of the tree table componentnode
- the NodeDescriptor
describing a tree nodeWindowManager
public NodeDescriptor getNode(java.lang.String treeTableName, int row)
treeTableName
- the attribute name of the tree table componentrow
- index of table rowNodeDescriptor
describing the tree node
in the specified table rowWindowManager
public void addExpansionListener(java.lang.String treeTableName, java.lang.Object listener)
TreeExpansionListener
which is notified when
the user expands a node in the specified tree table.
treeTableName
- the PDML attribute name of the tree tablelistener
- the instance of TreeExpansionListener
to be notifiedWindowManager
public void removeExpansionListener(java.lang.Object listener)
TreeExpansionListener
from the 'active list'
listener
- the instance of TreeExpansionListener
to be notifiedWindowManager
public void setExpanded(java.lang.String treeTableName, NodeDescriptor nd, boolean bExpand)
treeTableName
- the name of the tree table containing the node to be expanded
or collapsed (as specified in the PDML definition for the panel)node
- the NodeDescriptor of the tree node to be expanded or collapsedbExpand
- desired state of the node - true to expand, false to collapsepublic void addCommitListener(java.awt.event.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.
addCommitListener
in interface WindowManager
listener
- the instance of java.awt.event.ActionListener
to be notifiedWindowManager
public void addCommitListener(java.lang.Object listener)
addCommitListener
in interface WindowManager
public void addCancelListener(java.awt.event.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.
addCancelListener
in interface WindowManager
listener
- the instance of java.awt.event.ActionListener
to be notifiedWindowManager
public void addCancelListener(java.lang.Object listener)
addCancelListener
in interface WindowManager
public void dispose()
dispose
in interface WindowManager
WindowManager
public void handleDataException(IllegalUserDataException ex)
IllegalUserDataException
.
If the exception message is non-null it will be displayed to the user in a
message box. After the message box is closed, focus is set to the component
identified in the exception object so that the user can change the data
to a valid value.
handleDataException
in interface WindowManager
ex
- The IllegalUserDataException
for which
default handling is requested.WindowManager
,
applyChanges()
public static void handleDataException(IllegalUserDataException ex, java.awt.Container messageOwner)
IllegalUserDataException
.
If the exception message is non-null it will be displayed to the user in a
message box. After the message box is closed, focus is set to the component
identified in the exception object so that the user can change the data
to a valid value.
This is a static version of the method that can be called for PDML types that do
not have their own handleDataException
methods (like
TabbedPaneManager
).
This method is the same as the non-static version except that with this method, you pass in
the owner of the message. Note: In this version the component containing the invalid
data cannot be specified by name in the
IllegalUserDataException
object.
ex
- The IllegalUserDataException
for which default handling is requested.messageOwner
- The Container
which will be the owner of any message displayed.WindowManager
,
applyChanges()
public void displayHelp()
public javax.swing.JMenuBar getMenuBar()
JMenuBar
, or null
if no menu bar was defined.public javax.swing.JToolBar getToolBar()
JToolBar
, or null
if no toolbar was defined.public javax.swing.AbstractButton getToolBarButton(java.lang.String name)
name
- the name of the ButtonAbstractButton
, or null
if no button with this name was defined.public void setToolBarIcon(javax.swing.ImageIcon icon)
icon
- the icon to be displayedpublic boolean getSaveOnThread()
save
method
on the application's DataBean
objects will
be called on a non-UI thread.
true
if the save
method
will be called on a non-UI thread; false
if
the save
methods will be called on the
AWT event dispatch thread.setSaveOnThread(boolean)
public void setSaveOnThread(boolean saveOnThread)
save
method
on the application's DataBean
objects will
be called on a non-UI thread. The default is false
.
In general, requesting save
method calls on a
non-UI thread is the recommended approach. This is because
save
is typically a long-running method, and
if it executes on the UI thread the application's UI will
not respond to user input until the save operation completes.
Requesting a non-UI thread solves this problem - the panel managed
by this PanelManager
will be disabled for the
duration of the save operation, but the application's other
windows will be unaffected and continue to behave normally.
The downside to calling save
on a thread
is that any UI calls in the
save
method must be queued on the UI thread
via the SwingUtilities.invokeLater
mechanism.
A convenient way to do this is to bracket UI code
with the following:
SwingUtilities.invokeLater(new Runnable() { public void run() { <your UI code here> } });Using this technique the UI code still has access to member fields of the enclosing class. Local variables should either be enclosed in the inner class or declared final.
saveOnThread
- If true, call the save
method
on a non-UI thread; otherwise, call the save
method
on the AWT event dispatch thread.getSaveOnThread()
public void addHelpListener(HelpListener listener)
HelpListener
object will be notified when
context or panel help has been requested. If the listener is null
, the default
help system is used.
Only one HelpListener
can be defined for a panel.listener
- the object that will be notified when help is requested.HelpEvent
public void addActionListener(java.lang.String componentName, java.awt.event.ActionListener al)
componentName
These listeners will not be notified when DataBean updating occurs through calls
to loadData() or refreshComponent().componentName
- the identifier of the component to add the listener toal
- the ActionListener to be addedjava.lang.IllegalArgumentException
- if the component defined by componentName does not
fire an ActionEventremoveActionListener(java.lang.String, java.awt.event.ActionListener)
public void removeActionListener(java.lang.String componentName, java.awt.event.ActionListener al)
componentName
componentName
- the identifier of the component to remove the listener fromal
- the ActionListener to be removedjava.lang.IllegalArgumentException
- if the component defined by componentName does not
fire an ActionEventaddActionListener(java.lang.String, java.awt.event.ActionListener)
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The new name for this PanelManagerjava.lang.IllegalArgumentException
- if name is null or "" or if
this PanelManager has an aggregate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |