Class AbstractMMLButtonDialog

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
megamek.client.ui.dialogs.abstractDialogs.AbstractDialog
megamek.client.ui.dialogs.buttonDialogs.AbstractButtonDialog
megameklab.ui.dialog.AbstractMMLButtonDialog
All Implemented Interfaces:
WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
AmountDialog, PrintQueueDialog, SettingsDialog

public abstract class AbstractMMLButtonDialog extends megamek.client.ui.dialogs.buttonDialogs.AbstractButtonDialog
This is the Base Dialog for a dialog with buttons in MML. It extends Base Dialog, and adds a button panel with base Ok and Cancel buttons. It also includes an enum tracker for the result of the dialog.

Inheriting classes must call initialize() in their constructors and override createCenterPane()

The resources associated with this dialog need to contain at least the following keys: - "Ok.text" - text for the ok button - "Ok.toolTipText" - toolTipText for the ok button - "Cancel.text" - text for the cancel button - "Cancel.toolTipText" - toolTipText for the cancel button

See Also:
  • Constructor Details

    • AbstractMMLButtonDialog

      protected AbstractMMLButtonDialog(JFrame frame, String name, String title)
      This creates a modal AbstractMMLButtonDialog using the default MML resource bundle. This is the normal constructor to use for an AbstractMMLButtonDialog.
    • AbstractMMLButtonDialog

      protected AbstractMMLButtonDialog(JFrame frame, boolean modal, String name, String title)
      This creates an AbstractMMLButtonDialog using the default MML resource bundle. It allows one to create non-modal button dialogs, which is not recommended by default.
    • AbstractMMLButtonDialog

      protected AbstractMMLButtonDialog(JFrame frame, boolean modal, ResourceBundle resources, String name, String title)
      This creates an AbstractMMLButtonDialog using the specified resource bundle. This is not recommended by default.
  • Method Details

    • setPreferences

      protected void setPreferences() throws Exception
      This override forces the preferences for this class to be tracked in MML instead of MegaMek
      Overrides:
      setPreferences in class megamek.client.ui.dialogs.abstractDialogs.AbstractDialog
      Throws:
      Exception - if there's an issue initializing the preferences. Normally this means a component has not had its name value set.