Class PFCDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
AboutDialog

public class PFCDialog extends JDialog
Wrapper around a JDialog that displays a dialog as prescribed by the Portal UI guidelines. The appropriate borders, spacing, etc. are automatically applied - you simply provide the contents.
See Also:
  • Field Details

    • mHelpButton

      protected JButton mHelpButton
    • mSaveAsDefaultChkBox

      protected JCheckBox mSaveAsDefaultChkBox
    • mTopPanel

      protected JPanel mTopPanel
    • mMainPanel

      protected JPanel mMainPanel
    • mBtnPanel

      protected JPanel mBtnPanel
    • mOuterPanel

      protected Gripper mOuterPanel
    • mPreferredBtnSize

      protected Dimension mPreferredBtnSize
    • mButtonsArray

      protected ArrayList mButtonsArray
    • mDialogInitialized

      protected boolean mDialogInitialized
    • BUTTON_START_LOCATION

      protected static final int BUTTON_START_LOCATION
      See Also:
  • Constructor Details

    • PFCDialog

      public PFCDialog(Dialog owner)
      Creates a non-modal dialog without a title with the specifed Dialog as its owner.
      Parameters:
      owner - the Dialog from which the dialog is displayed
    • PFCDialog

      public PFCDialog(Dialog owner, boolean modal)
      Creates a modal or non-modal dialog without a title and with the specified owner dialog.

      Parameters:
      owner - the Dialog from which the dialog is displayed
      modal - true for a modal dialog, false for one that allows other windows to be active at the same time
    • PFCDialog

      public PFCDialog(Dialog owner, String title)
      Creates a non-modal dialog with the specified title and with the specified owner dialog.
      Parameters:
      owner - the Dialog from which the dialog is displayed
      title - the String to display in the dialog's title bar
    • PFCDialog

      public PFCDialog(Dialog owner, String title, boolean modal)
      Creates a modal or non-modal dialog with the specified title and the specified owner frame.
      Parameters:
      owner - the Dialog from which the dialog is displayed
      title - the String to display in the dialog's title bar
      modal - true for a modal dialog, false for one that allows other windows to be active at the same time
    • PFCDialog

      public PFCDialog(Dialog owner, String title, JPanel mainPanel, boolean modal)
      Creates a modal or non-modal dialog with the specified title, the specified owner frame and the specified main panel.
      Parameters:
      owner - the Dialog from which the dialog is displayed
      title - the String to display in the dialog's title bar
      mainPanel - the JPanel to display in the dialog's main area
      modal - true for a modal dialog, false for one that allows other windows to be active at the same time
    • PFCDialog

      public PFCDialog(Dialog owner, String title, JPanel topPanel, JPanel mainPanel, boolean modal)
      Creates a modal or non-modal dialog with the specified title, the specified owner frame, the specified main panel and the specified top panel.
      Parameters:
      owner - the Dialog from which the dialog is displayed
      title - the String to display in the dialog's title bar
      topPanel - the JPanel to display in the dialog's top area
      mainPanel - the JPanel to display in the dialog's main area
      modal - true for a modal dialog, false for one that allows other windows to be active at the same time
    • PFCDialog

      public PFCDialog()
      Creates a non-modal dialog without a title and without a specified Frame owner. A shared, hidden frame will be set as the owner of the dialog.
    • PFCDialog

      public PFCDialog(Frame owner)
      Creates a non-modal dialog without a title with the specifed Frame as its owner.
      Parameters:
      owner - the Frame from which the dialog is displayed
    • PFCDialog

      public PFCDialog(Frame owner, boolean modal)
      Creates a modal or non-modal dialog without a title and with the specified owner Frame.
      Parameters:
      owner - the Frame from which the dialog is displayed
      modal - true for a modal dialog, false for one that allows others windows to be active at the same time
    • PFCDialog

      public PFCDialog(Frame owner, String title)
      Creates a non-modal dialog with the specified title and with the specified owner frame.
      Parameters:
      owner - the Frame from which the dialog is displayed
      title - the String to display in the dialog's title bar
    • PFCDialog

      public PFCDialog(Frame owner, String title, boolean modal)
      Creates a modal or non-modal dialog with the specified title and the specified owner Frame. All constructors defer to this one.

      NOTE: Any popup components (JComboBox, JPopupMenu, JMenuBar) created within a modal dialog will be forced to be lightweight.

      Parameters:
      owner - the Frame from which the dialog is displayed
      title - the String to display in the dialog's title bar
      modal - true for a modal dialog, false for one that allows other windows to be active at the same time
    • PFCDialog

      public PFCDialog(Frame owner, String title, JPanel mainPanel, boolean modal)
      Creates a modal or non-modal dialog with the specified title, the specified owner frame and the specified main panel.
      Parameters:
      owner - the Frame from which the dialog is displayed
      title - the String to display in the dialog's title bar
      mainPanel - the JPanel to display in the dialog's main area
      modal - true for a modal dialog, false for one that allows other windows to be active at the same time
    • PFCDialog

      public PFCDialog(Frame owner, String title, JPanel topPanel, JPanel mainPanel, boolean modal)
      Creates a modal or non-modal dialog with the specified title, the specified owner frame, the specified main panel and the specified top panel.
      Parameters:
      owner - the Frame from which the dialog is displayed
      title - the String to display in the dialog's title bar
      topPanel - the JPanel to display in the dialog's top area
      mainPanel - the JPanel to display in the dialog's main area
      modal - true for a modal dialog, false for one that allows other windows to be active at the same time
  • Method Details

    • showConfirmDialog

      public static int showConfirmDialog(Component owner, String title, JPanel topPanel, JComponent mainPanel)
      Convenience wrapper that manages the button display automatically. 2 buttons are displayed, OK and CANCEL.
      Parameters:
      owner - the Frame from which the dialog is displayed
      title - the String to display in the dialog's title bar
      topPanel - the JPanel to display in the dialog's top area
      mainPanel - the JPanel to display in the dialog's main area
      Returns:
      One of JOptionPane.OK or JOptionPane.CANCEL
    • showConfirmDialog

      public static int showConfirmDialog(Component owner, String title, JPanel topPanel, JComponent mainPanel, JTextField tf)
      Convenience wrapper that manages the button display automatically. 2 buttons are displayed, OK and CANCEL. If the textfield parameter is non-null, the assumption is that this textfield is contained within the dialog and the caller wants the user to be able to hit Enter and impact the OK button.
      Parameters:
      owner - the Component on which to center this dialog. This component should be in a JFrame
      title - the String to display in the dialog's title bar
      topPanel - the JPanel to display in the dialog's top area
      mainPanel - the JPanel to display in the dialog's main area
      tf - JTextField contained in either the topPanel or mainPanel. Hitting the Enter key in the textfield will have the same effect as the user pressing the OK button.
      Returns:
      One of JOptionPane.OK or JOptionPane.CANCEL
    • setTopPanel

      public void setTopPanel(JPanel topPanel)
      Sets the top panel in the dialog to be displayed.
      Parameters:
      topPanel - the top panel to be displayed in this dialog
    • setMainPanel

      public void setMainPanel(JPanel mainPanel)
      Sets the main panel in the dialog to be displayed.
      Parameters:
      mainPanel - the main panel to be displayed in this dialog
    • setVisible

      public void setVisible(boolean b)
      Overrides:
      setVisible in class Dialog
    • addButton

      public void addButton(JButton button)
      Adds the specified button to the right most position on the button panel which is at the bottom of the dialog.
      Parameters:
      button - the button will be added to the end of the button panel
    • setHelpID

      public void setHelpID(String helpID)
      Displays a Help button at the left most position of the button panel which displays a help page for the specified help ID.
      Parameters:
      helpID - the help ID to be associated with the help button.
    • setHelpID

      public void setHelpID(ImageIcon helpIcon, String helpID)
      Displays a Help button with the specified icon at the left most position of the button panel which displays a help page for the specified help ID.
      Parameters:
      helpIcon - the icon to be display on the help button.
      helpID - the help ID to be associated with the help button.
    • hideHelpButton

      public void hideHelpButton()
      Hides the help button on the dialog.
    • setSaveAsDefault

      public void setSaveAsDefault()
      Displays a "Save as default" check box in between the help button and the button group.
    • isSaveAsDefault

      public boolean isSaveAsDefault()
      Returns whether the "Save As Default" check box is being checked.
    • setCentered

      protected void setCentered()
    • initPFCDialog

      protected void initPFCDialog(JPanel topPanel, JPanel mainPanel)
    • getResourceBundle

      protected static ResourceBundle getResourceBundle()
    • initPFCDialogLayout

      protected void initPFCDialogLayout()
    • setPanelsLnF

      protected void setPanelsLnF()
    • setPreferredBtnSize

      protected void setPreferredBtnSize()
    • setColors

      protected void setColors(JComponent c)