|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.as400.ui.framework.java.PanelManager
public class PanelManager extends Object implements PaneManager, WindowManager
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.
EventHandlers
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 DataBeans 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 or region 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| Modifier and Type | Field and Description |
|---|---|
protected int |
m_windowMinHeight
|
protected int |
m_windowMinWidth
|
| Fields inherited from interface com.ibm.as400.ui.framework.java.WindowManager |
|---|
OFFSET_FROM_OWNER |
| Modifier | Constructor and Description |
|---|---|
protected |
PanelManager(DataBean[] dataBeans,
Container container)
|
|
PanelManager(String baseName,
Locale locale,
String panelName)
Constructs a PanelManager for the specified panel,
and then serializes the panel definition. |
|
PanelManager(String baseName,
Locale locale,
String panelName,
DataBean[] dataBeans)
Constructs a PanelManager for the specified panel. |
|
PanelManager(String baseName,
Locale locale,
String panelName,
DataBean[] dataBeans,
Container container)
Constructs a PanelManager for the specified panel,
using the specified container. |
|
PanelManager(String baseName,
Locale locale,
String panelName,
DataBean[] dataBeans,
Frame owner)
Constructs a PanelManager for the specified panel. |
|
PanelManager(String baseName,
String panelName,
DataBean[] dataBeans)
Constructs a PanelManager for the specified panel. |
|
PanelManager(String baseName,
String panelName,
DataBean[] dataBeans,
Container container)
Constructs a PanelManager for the specified panel,
using the specified container. |
|
PanelManager(String baseName,
String panelName,
DataBean[] dataBeans,
Frame owner)
Constructs a PanelManager for the specified panel. |
| Modifier and Type | Method and Description |
|---|---|
void |
activatePanel()
Runs the activation handlers for this panel. |
void |
addActionListener(String componentName,
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
The ActionEvent passed to the listener object will
have its action command string set to "Activated". |
void |
addCancelListener(ActionListener listener)
Adds an ActionListener which is notified when
the user cancels out of a window. |
void |
addCancelListener(Object listener)
|
void |
addCommitListener(ActionListener listener)
Adds an ActionListener which is notified when
commit processing is complete. |
void |
addCommitListener(Object listener)
|
void |
addExpansionListener(String treeTableName,
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 DataBeans
which manage the data. |
void |
applyChanges(String componentName)
Transmits changes to user data to the DataBeans
which manage the data. |
void |
commit(Vector committedDataBeans)
Commits the changes to data displayed on the panel. |
void |
displayHelp()
Displays the overview help for the panel. |
protected void |
displayHelp(String sIcon)
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. |
Component |
getComponent(String name)
Returns the panel component identified by name. |
com.ibm.as400.ui.framework.java.JavaComponentDescriptor |
getComponentDescriptor(String name)
Returns the JavaComponentDescriptor for the specified panel component. |
String |
getComponentText(String componentName)
Convenience method which gets the component's text |
Container |
getContainer()
Returns the container which holds the user interface components for the panel. |
DataBean[] |
getDataBeans()
Returns the list of DataBeans that was
specified on this object's constructor. |
PaneManager |
getDelegateManager(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(String componentName)
Returns any specialized formatter to be used for a component. |
String |
getIconName()
Returns the name of the icon used for this panel. |
JMenuBar |
getMenuBar()
Returns the menu bar defined for this panel. |
MenuManager |
getMenuManager(String name)
Returns a MenuManager associated with this panel's menu bar. |
String |
getName()
Gets this PanelManager's name |
NodeDescriptor |
getNode(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. |
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(String treeTableName,
NodeDescriptor nd)
Returns the table row number containing the specified tree node |
String |
getTitle()
Returns the panel's title. |
JToolBar |
getToolBar()
Returns the toolbar defined for this panel. |
AbstractButton |
getToolBarButton(String name)
Returns a JComponent from the ToolBar |
Window |
getWindow()
Returns the main panel window. |
void |
handleDataException(IllegalUserDataException ex)
Provides the default handling for an IllegalUserDataException. |
static void |
handleDataException(IllegalUserDataException ex,
Container messageOwner)
Provides the default handling for an IllegalUserDataException. |
protected boolean |
isContainerScrollable()
|
boolean |
isEnabled(String name)
Determines whether the panel component identified by name is Enabled. |
boolean |
isRequiredField(String componentName)
Returns whether this entry-field requires a non-blank entry |
boolean |
isVisible()
Determines whether this panel is visible. |
boolean |
isVisible(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(String[] args)
Provides a command line interface to PanelManager. |
void |
prepareToCommit(Vector preparedDataBeans)
Request the DataBeans which manage data for the
panel to verify that their data is in a consistent state. |
void |
refreshComponent(String componentName)
Reloads a UI component with updated data from the component's DataBean. |
void |
refreshTree(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(String componentName,
ActionListener al)
Removes an ActionListener from the component identified by componentName |
void |
removeExpansionListener(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(String buttonName,
String text)
Sets the button's text |
void |
setComponentText(String componentName,
String text)
Convenience method which sets the component's text |
void |
setEnabled(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(String treeTableName,
NodeDescriptor nd,
boolean bExpand)
Programmatically expand or collapse a node in a tree component |
protected void |
setFocusPolicy(boolean b)
|
void |
setFormatter(String componentName,
DataFormatter formatter,
boolean required)
Sets a pre-created formatter to be used for a component. |
void |
setHelpPath(String path)
Base location for help files. |
void |
setIconName(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(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(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(String title)
Overrides the panel title defined in the panel definition. |
void |
setToolBarIcon(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(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(String paneName)
Displays the specified pane. |
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 |
|---|
protected PanelManager(DataBean[] dataBeans,
Container container)
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.
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 DataBeans which supply data to the panel (may be null)DisplayManagerException - if an error was encountered accessing the panel definitionDisplayManagerException
public PanelManager(String baseName,
Locale locale,
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 DataBeans which supply data to the panel (may be null)DisplayManagerException - if an error was encountered accessing the panel definitionDisplayManagerException
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.
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 DataBeans 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(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.
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 DataBeans 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(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.
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 DataBeans 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(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.
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 DataBeans 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(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.
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(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 or region code, and optional variant codes, each delimited by an underscore ("_") character.
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(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(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 String getIconName()
getIconName()public void setHelpPath(String path)
PaneManagersetHelpPath("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 PaneManagerpublic 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 WindowManagershow - If true, shows the panel; otherwise, hides the panel.isVisible(),
WindowManagerpublic boolean isVisible()
isVisible in interface WindowManagersetVisible(boolean),
WindowManagerpublic DataBean[] getDataBeans()
DataBeans that was
specified on this object's constructor.
Vector of DataBeanspublic 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.
protected boolean isContainerScrollable()
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 notifiedEventHandlerpublic Dimension getPreferredSize()
public void refreshComponent(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(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 String toString()
toString in class Object
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.
setFormatter in interface PaneManagercomponentName - the name of the component as specified in the panel definitionformatter - a DataFormatter subclassed objectrequired - a value is required for this componentDataFormatterpublic DataFormatter getFormatter(String componentName)
getFormatter in interface PaneManagercomponentName - 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(String componentName,
boolean required)
componentName - the name of the component as specified in the panel definitionrequired - whether this field should be requiredIllegalArgumentException - if no formatter is specified for this fieldDataFormatterpublic boolean isRequiredField(String componentName)
componentName - the name of the component as specified in the panel definitionIllegalArgumentException - if no formatter is specified for this fieldDataFormatter
public void setButtonText(String buttonName,
String text)
buttonName - the name of the button as specified in the panel definitiontext - The text to display on the buttonIllegalArgumentException - if there isn't a button named buttonNameDataFormatter
public void setComponentText(String componentName,
String text)
componentName - the name of the component as specified in the panel definitiontext - The text to display on the componentIllegalArgumentException - if there isn't a component named componentNameIllegalArgumentException - if the component doesn't have a way to set textpublic String getComponentText(String componentName)
componentName - the name of the component as specified in the panel definitionIllegalArgumentException - if there isn't a component named componentNameIllegalArgumentException - if the component doesn't have a way to get textpublic MenuManager getMenuManager(String name)
name - the name of the menu as specified in the panel definitionMenuManager or null if not foundMenuManagerpublic String getTitle()
Returns null if the application supplied the container to be managed.
getTitle in interface PaneManagerPaneManager,
setTitle(java.lang.String)public void loadData()
loadData in interface PaneManagerPaneManagerprotected void setFocusPolicy(boolean b)
public void activatePanel()
setVisible
if they supplied their own container on the constructor.
activatePanel in interface PaneManagersetVisible(boolean),
PaneManagerpublic void showPane(String paneName)
PanelManager's single
pane is always visible.
showPane in interface PaneManagerpaneName - the name of the pane to be displayed, as defined in the PDML for this PaneManagerPaneManagerpublic Component getComponent(String name)
getComponent in interface PaneManagername - the name of the component as specified in the panel definitionComponent having the name specifiedPaneManager
public void setEnabled(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(String name)
name - the name of the component as specified in the panel definition
public void setVisible(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(String name)
name - the name of the component as specified in the panel definitionpublic com.ibm.as400.ui.framework.java.JavaComponentDescriptor getComponentDescriptor(String name)
JavaComponentDescriptor for the specified panel component.
getComponentDescriptor in interface PaneManagername - the name of the component as specified in the panel definitionJavaComponentDescriptor for the componentPaneManagerpublic PaneManager getDelegateManager(String paneName)
PaneManager to which the receiver is delegating
management of the specified subpane.
getDelegateManager in interface PaneManagerpaneName - the name of the pane as specified in the PDML definitionPaneManager, or null if the object cannot be foundPaneManagerpublic 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 PaneManagermgr - the PaneManager with which the receiver is to be associatedPaneManagerpublic PaneManager getAggregateManager()
PaneManager for the receiver.
getAggregateManager in interface PaneManagerPaneManager 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.PaneManagerpublic PaneManager getRootManager()
PaneManager for the receiver.
getRootManager in interface PaneManagerPaneManager 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
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 panel is about to be closed.
applyChanges in interface PaneManagerIllegalUserDataExceptionPaneManager
public void applyChanges(String componentName)
throws IllegalUserDataException
DataBeans
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.IllegalUserDataExceptionapplyChanges()public void prepareToCommit(Vector preparedDataBeans)
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 panel.
This method is called when the panel is about to be closed.
prepareToCommit in interface PaneManagerpreparedDataBeans - a list of DataBeans which have already
been prepared on the current commit operationPaneManagerpublic void commit(Vector committedDataBeans)
commit method on all DataBeans
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 PaneManagercommittedDataBeans - a list of DataBeans which have already
been saved on the current commit operationPaneManagerpublic Window getWindow()
getWindow in interface WindowManagerWindowManagerpublic 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 WindowManagermgr - the WindowManager managing the panel
in relation to which this object's panel location is determinedWindowManagerpublic 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 WindowManagerWindowManager managing the window
in relation to which this object's window location is determinedWindowManager
public int getTableRow(String treeTableName,
NodeDescriptor nd)
treeTableName - the attribute name of the tree table componentnode - the NodeDescriptor describing a tree nodeWindowManager
public NodeDescriptor getNode(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(String treeTableName,
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 notifiedWindowManagerpublic void removeExpansionListener(Object listener)
TreeExpansionListener from the 'active list'
listener - the instance of TreeExpansionListener to be notifiedWindowManager
public void setExpanded(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(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 WindowManagerlistener - the instance of java.awt.event.ActionListener to be notifiedWindowManagerpublic void addCommitListener(Object listener)
addCommitListener in interface WindowManagerpublic 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.
addCancelListener in interface WindowManagerlistener - the instance of java.awt.event.ActionListener to be notifiedWindowManagerpublic void addCancelListener(Object listener)
addCancelListener in interface WindowManagerpublic void dispose()
dispose in interface WindowManagerWindowManagerpublic 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 WindowManagerex - The IllegalUserDataException for which
default handling is requested.WindowManager,
applyChanges()
public static void handleDataException(IllegalUserDataException ex,
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 JMenuBar getMenuBar()
JMenuBar, or null if no menu bar was defined.public JToolBar getToolBar()
JToolBar, or null if no toolbar was defined.public AbstractButton getToolBarButton(String name)
name - the name of the ButtonAbstractButton, or null if no button with this name was defined.public void setToolBarIcon(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(String componentName,
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 addedIllegalArgumentException - if the component defined by componentName does not
fire an ActionEventremoveActionListener(java.lang.String, java.awt.event.ActionListener)
public void removeActionListener(String componentName,
ActionListener al)
componentName
componentName - the identifier of the component to remove the listener fromal - the ActionListener to be removedIllegalArgumentException - if the component defined by componentName does not
fire an ActionEventaddActionListener(java.lang.String, java.awt.event.ActionListener)public String getName()
public void setName(String name)
name - The new name for this PanelManagerIllegalArgumentException - if name is null or "" or if
this PanelManager has an aggregateprotected void displayHelp(String sIcon)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||