Class BasicDialog

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
ConnectionDialog, ConnectionDialogHipo

public class BasicDialog extends JDialog implements ActionListener
Author:
gavalian
See Also:
  • Field Details Link icon

    • northComponent Link icon

      protected Component northComponent
    • southComponent Link icon

      protected Component southComponent
    • eastComponent Link icon

      protected Component eastComponent
    • westComponent Link icon

      protected Component westComponent
    • centerComponent Link icon

      protected Component centerComponent
    • _closeout Link icon

      protected String[] _closeout
    • reason Link icon

      protected String reason
    • buttonPanel Link icon

      protected JPanel buttonPanel
  • Constructor Details Link icon

    • BasicDialog Link icon

      public BasicDialog(String title, boolean modal, String... closeout)
      Create a SimpleDialog
      Parameters:
      title - the title of the dialog
      modal - if true the dialog is modal
      closeout - a set of closeout labels
  • Method Details Link icon

    • addMenus Link icon

      protected void addMenus()
      Add menus to the dialog. The default implementation does nothing.
    • checkButtons Link icon

      protected void checkButtons()
      Check the enabled state of all the buttons. Default implementation does nothing.
    • sizeDialog Link icon

      protected void sizeDialog()
      This can be overriden to provde the size of the dialog. The default implementation is to call pack.
    • createNorthComponent Link icon

      protected Component createNorthComponent()
      Override to create the component that goes in the north.
      Returns:
      the component that is placed in the north
    • createSouthComponent Link icon

      protected Component createSouthComponent()
      Override to create the component that goes in the south.
      Returns:
      the component that is placed in the south. The default implementation creates a row of closeout buttons.
    • getButton Link icon

      public AbstractButton getButton(String label)
      Get the first button on this dialog with the given label. This will search all buttons, not just the closout buttons, so it is safe only if no more than one button has the given label.
      Parameters:
      label - the label to search for.
      Returns:
      the first button among its components that has the given label, or null.
    • setButtonEnabled Link icon

      public void setButtonEnabled(String label, boolean enabled)
      Enable or disable a button with a given label. Assumes no more than one button has the given label.
      Parameters:
      label - the label to match
      enabled - the enable flag
    • prepare Link icon

      protected void prepare()
      can do preparation--for example a component might be added on "createCenterComponent" but a reference needed in "addNorthComponent"
    • createEastComponent Link icon

      protected Component createEastComponent()
      Override to create the component that goes in the east.
      Returns:
      the component that is placed in the east
    • createWestComponent Link icon

      protected Component createWestComponent()
      Override to create the component that goes in the west.
      Returns:
      the component that is placed in the west.
    • createCenterComponent Link icon

      protected Component createCenterComponent()
      Override to create the component that goes in the center. Usually this is the "main" component.
      Returns:
      the component that is placed in the center
    • actionPerformed Link icon

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • getReason Link icon

      public String getReason()
      Get the reason that the dialog was closed, which is just the label of the last button hit.
      Returns:
      the label of the last button hit.
    • handleCommand Link icon

      protected void handleCommand(String command)
      A closeout button was hit. The default behavior is to shutdown the dialog.
      Parameters:
      command - the label on the button that was hit.
    • waitCursor Link icon

      public void waitCursor()
      Set the wait cursor
    • defaultCursor Link icon

      public void defaultCursor()
      Restore the default cursor
    • main Link icon

      public static void main(String[] arg)