com.ibm.as400.ui.framework.java
Interface WindowManager

All Known Implementing Classes:
PropertySheetManager, WizardManager, PanelManager

public interface WindowManager

The interface which defines the function that standalone windows and dialogs in the UI framework must be capable of supporting. A WindowManager can display or hide its window, and must be capable of cascading its window relative to other windows on the screen.

Since:
v4r2m0
See Also:
PanelManager, PropertySheetManager, WizardManager

Field Summary
static int OFFSET_FROM_OWNER
          Number of pixels by which a modal dialog should be offset from its owner.
 
Method Summary
 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 dispose()
          Closes the panel and releases all resources used by the panel and its associated UI components.
 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.Window getWindow()
          Returns the window being managed by this WindowManager.
 void handleDataException(IllegalUserDataException ex)
          Provides the default handling for an IllegalUserDataException.
 boolean isVisible()
          Determines whether the window being managed by this WindowManager is currently visible.
 void setModalRelativeTo(WindowManager mgr)
          Sets the location of the window being managed relative to a window managed by the specified WindowManager.
 void setVisible(boolean show)
          Shows or hides the window being managed by this WindowManager, depending on the value of parameter show.
 

Field Detail

OFFSET_FROM_OWNER

public static final int OFFSET_FROM_OWNER
Number of pixels by which a modal dialog should be offset from its owner.
Method Detail

getWindow

public java.awt.Window getWindow()
Returns the window being managed by this WindowManager. The window may be an instance of either JDialog or JFrame, depending on whether the main window is modal or modeless.
Returns:
the main window for this WindowManager
Since:
v4r2m0

setModalRelativeTo

public void setModalRelativeTo(WindowManager mgr)
Sets the location of the window being managed relative to a window managed by the specified WindowManager. If the window is not currently showing, the window for this WindowManager is centered on the screen.
Parameters:
mgr - the WindowManager managing the window in relation to which this object's window location is determined
Since:
v4r2m0

getOwnerManager

public 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.
Returns:
the WindowManager managing the window in relation to which this object's window location is determined
Since:
v4r5m0

addCommitListener

public void addCommitListener(java.awt.event.ActionListener listener)
Adds an ActionListener which is notified when commit processing is complete.

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

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

Parameters:
listener - the instance of java.awt.event.ActionListener to be notified
Since:
v4r2m0

addCommitListener

public void addCommitListener(java.lang.Object listener)
Since:
v5r1m0

addCancelListener

public void addCancelListener(java.awt.event.ActionListener listener)
Adds an ActionListener which is notified when the user cancels out of a window.

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

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

Parameters:
listener - the instance of java.awt.event.ActionListener to be notified
Since:
v4r2m0

addCancelListener

public void addCancelListener(java.lang.Object listener)
Since:
v5r1m0

dispose

public void dispose()
Closes the panel and releases all resources used by the panel and its associated UI components.
Since:
v5r1m0

handleDataException

public void handleDataException(IllegalUserDataException ex)
Provides the default handling for an 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.

Parameters:
ex - The IllegalUserDataException for which default handling is requested.
Since:
v5r1m0

setVisible

public void setVisible(boolean show)
Shows or hides the window being managed by this WindowManager, depending on the value of parameter show. If the window is modal, the application will block on the call to setVisible until the window has closed.
Parameters:
show - If true, shows the window; otherwise, hides the window.
Since:
v5r1m0
See Also:
isVisible()

isVisible

public boolean isVisible()
Determines whether the window being managed by this WindowManager is currently visible.
Returns:
true if the window is visible; false otherwise.
Since:
v5r1m0
See Also:
setVisible(boolean)