Package jmri.swing

Interface PreferencesPanel

All Superinterfaces:
JmriServiceProviderInterface
All Known Subinterfaces:
ManagingPreferencesPanel, PreferencesSubPanel
All Known Implementing Classes:
BuildReportOptionPanel, ConnectionsPreferencesPanel, ConsistToolPrefsPanel, EditManifestHeaderTextPanel, EditManifestTextPanel, EditSwitchListTextPanel, FileLocationPane, FrameServletPreferencesPanel, GuiLafConfigPane, GuiLocalePreferencesPanel, JmriSRCPServerPreferencesPanel, JmrixConfigPane, JsonServerPreferencesPanel, JsonServerPreferencesPanel, LnTcpPreferencesPanel, ManagerDefaultsConfigPane, OperationsPreferencesPanel, OperationsSetupPanel, OptionPanel, PreferencesPane, PrintMoreOptionPanel, PrintOptionPanel, ProfilePreferencesPanel, ProgrammerConfigPane, RailroadNamePreferencesPanel, RosterConfigPane, SimpleServerPreferencesPanel, StartupActionsPreferencesPanel, StreamConfigPane, SystemConsoleConfigPanel, ThrottlesPreferencesPane, UserMessagePreferencesPane, WarrantPreferencesPanel, WebServerPreferencesPanel, WiThrottlePrefsPanel

public interface PreferencesPanel
extends JmriServiceProviderInterface
An interface to define methods that the Preferences Window can and should expect Preferences panels to implement. This class allows the Preferences Window become less formally aware of all possible preferences settings in JMRI, and to instead interrogate a PreferencesPanel for most of the information that the Preferences window requires to add the PreferencesPanel to the window.
  • Method Summary

    Modifier and Type Method Description
    String getLabelKey()
    Text displayed above the preferences panel This label is only displayed if the preferences panel is in a tabbed set of preferences.
    JComponent getPreferencesComponent()
    Get the preferences component for display
    String getPreferencesItem()
    Get the Preferences Item identifier.
    String getPreferencesItemText()
    Get the text for the Preferences Item in the preferences window list of preferences categories.
    String getPreferencesTooltip()
    The tooltip to display for a tabbed preferences panel
    default int getSortOrder()
    Indicate the sort order to be used to sort PreferencesPanels in TabbedPreferences.
    String getTabbedPreferencesTitle()
    Get the title for the tab containing this preferences item.
    boolean isDirty()
    Indicate that preferences need to be saved.
    boolean isPersistant()
    Indicates that this PrefernecesPanel should be stored across application starts by the PreferencesManager This should be true if the implementing class relies on the ConfigureManager stores and retrieves the preferences managed by the implementing class on behalf of the implementing class.
    boolean isPreferencesValid()
    Indicate that the preferences are valid.
    boolean isRestartRequired()
    Indicate that the preferences will not take effect until restarted.
    void savePreferences()
    Save any changes to preferences.
  • Method Details

    • getPreferencesItem

      Get the Preferences Item identifier. Multiple PreferencePanels can be displayed as tabs in a single item. Preferences items are listed in the menu on the left of the preferences window.
      Returns:
      the preferences item identifier.
    • getPreferencesItemText

      Get the text for the Preferences Item in the preferences window list of preferences categories. Multiple PreferencePanels can be displayed as tabs in a single item. Preferences items are listed in the menu on the left of the preferences window.
      Returns:
      the text for the preferences item.
    • getTabbedPreferencesTitle

      Get the title for the tab containing this preferences item.
      Returns:
      a tab title
    • getLabelKey

      Text displayed above the preferences panel This label is only displayed if the preferences panel is in a tabbed set of preferences. This label can contain multiple lines.
      Returns:
      label text
    • getPreferencesComponent

      Get the preferences component for display
      Returns:
      the preferences panel
    • isPersistant

      boolean isPersistant()
      Indicates that this PrefernecesPanel should be stored across application starts by the PreferencesManager This should be true if the implementing class relies on the ConfigureManager stores and retrieves the preferences managed by the implementing class on behalf of the implementing class.
      Returns:
      false if the implementing class stores its own preferences
    • getPreferencesTooltip

      The tooltip to display for a tabbed preferences panel
      Returns:
      tooltip text
    • savePreferences

      Save any changes to preferences. This method is called for every instance of a PreferencesPanel that is loaded by TabbedPreferences if isPersistant() is false.
    • isDirty

      boolean isDirty()
      Indicate that preferences need to be saved.
      Returns:
      true if preferences need to be saved, false otherwise
    • isRestartRequired

      Indicate that the preferences will not take effect until restarted.
      Returns:
      true if the application needs to restart
    • isPreferencesValid

      Indicate that the preferences are valid.
      Returns:
      true if the preferences are valid, false otherwise
    • getSortOrder

      default int getSortOrder()
      Indicate the sort order to be used to sort PreferencesPanels in TabbedPreferences. PreferencesPanels with the same sort order value are alphabetically within that sort order.
      Returns:
      the sort order; default implementation returns Integer.MAX_VALUE.