My Movies 1.0.0

hirondelle.movies.util.ui
Class StandardDialog

Object
  extended by StandardDialog

public final class StandardDialog
extends Object

Standard dialog, centralizing various display policies.

Using a standard class for all dialogs increases the uniformity of the application's appearance, and eliminates code repetition.

This standard dialog has the following characteristics :

Taken individually, such policies are relatively minor. Taken as a group, they form an effective way of establish the overall feel of your application.

Login dialogs
Login dialogs represent a special case, since they have no parent JFrame. Thus, they cannot inherit an icon. In JDK 6, this can be fixed, by adding a method to this class to specify the icon.

In addition, closing a login dialog should cause the application to exit. However, JDialog.setDefaultCloseOperation(int) does not allow for that behavior, while this class does.

This class does not extend JDialog, since it doesn't need to. As a pleasant side-effect of this choice, the javadoc for this class is greatly simplified.


Constructor Summary
StandardDialog(JFrame aOwner, String aTitle, boolean aIsModal, OnClose aOnClose, JPanel aBody, List<JButton> aButtons)
          Construct a standard dialog.
 
Method Summary
 void display()
          Display the dialog.
 void dispose()
          Call dispose on the underlying dialog object.
 JDialog getDialog()
          Return the underlying dialog object.
 void setDefaultButton(JButton aButton)
          Assign a default button for this dialog.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardDialog

public StandardDialog(JFrame aOwner,
                      String aTitle,
                      boolean aIsModal,
                      OnClose aOnClose,
                      JPanel aBody,
                      List<JButton> aButtons)
Construct a standard dialog.

Parameters:
aOwner - the frame which is the owner/caller/parent of this dialog. This dialog gets its icon and its position from the owner. Possibly null. It's strongly recommened to use a non-null owner.
aTitle - the text to appear on the title bar of this dialog
aIsModal - controls whether this dialog is modal: if true, then this dialog must be dismissed before you are allowed to return to the main window.
aOnClose - specifies desired behavior when this dialog closes
aBody - the body of the dialog, where the user enters information
aButtons - a row of buttons appearing at the bottom of this dialog
Method Detail

display

public void display()
Display the dialog.

The dialog is not automatically displayed in the constructor. This is because some callers may want to build a dialog upon startup, but only display it later. (Such a style might be chosen in order to slightly improve the apparent responsiveness of the application.)


setDefaultButton

public void setDefaultButton(JButton aButton)
Assign a default button for this dialog.


dispose

public void dispose()
Call dispose on the underlying dialog object.


getDialog

public JDialog getDialog()
Return the underlying dialog object.


My Movies 1.0.0

Copyright Hirondelle Systems - Generated 2008Dec30.15.53