Class AbstractTabbedPane

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTabbedPane
megamek.client.ui.dialogs.unitSelectorDialogs.AbstractTabbedPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants

public abstract class AbstractTabbedPane extends JTabbedPane
This is the default TabbedPane. It handles preferences, resources, and the frame.

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

This is directly tied to MekHQ's AbstractMHQTabbedPane, and any changes here MUST be verified there.

See Also:
  • Field Details

  • Constructor Details

    • AbstractTabbedPane

      @Deprecated(since="0.51.0", forRemoval=true) protected AbstractTabbedPane(JFrame frame, String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This creates an AbstractTabbedPane using the default resource bundle. This is the normal constructor to use for an AbstractTabbedPane.
    • AbstractTabbedPane

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

    • getFrame

      public JFrame getFrame()
    • setFrame

      public void setFrame(JFrame frame)
    • initialize

      protected abstract void initialize()
      This initializes the tabbed pane, and must be called by inheriting constructors. This MUST end with a call to setPreferences() for this class to work properly.
    • setPreferences

      protected void setPreferences()
      This is used to set preferences based on the preference node for this class. It is overridden for MekHQ usage
    • setPreferences

      protected void setPreferences(PreferencesNode preferences)
      This sets the base preferences for this class, and calls the custom preferences method
    • setCustomPreferences

      protected void setCustomPreferences(PreferencesNode preferences) throws Exception
      Adds custom preferences to the child pane.

      By default, this pane will track preferences related to the previously selected tab. Other preferences can be added by overriding this method.

      Parameters:
      preferences - the preference node for this pane
      Throws:
      Exception - if there's an issue initializing the preferences. Normally this means a component has not had its name value set.