Package jmri.swing

Interface PreferencesPanel

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default java.util.function.BooleanSupplier getIsEnabled()
      Offers a way to tell if this panel is currently enabled or not.
      java.lang.String getLabelKey()
      Text displayed above the preferences panel This label is only displayed if the preferences panel is in a tabbed set of preferences.
      javax.swing.JComponent getPreferencesComponent()
      Get the preferences component for display
      java.lang.String getPreferencesItem()
      Get the Preferences Item identifier.
      java.lang.String getPreferencesItemText()
      Get the text for the Preferences Item in the preferences window list of preferences categories.
      java.lang.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.
      java.lang.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 Detail

      • getPreferencesItem

        java.lang.String 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

        java.lang.String 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

        java.lang.String getTabbedPreferencesTitle()
        Get the title for the tab containing this preferences item.
        Returns:
        a tab title
      • getLabelKey

        java.lang.String 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

        javax.swing.JComponent 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

        java.lang.String getPreferencesTooltip()
        The tooltip to display for a tabbed preferences panel
        Returns:
        tooltip text
      • isDirty

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

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

        boolean 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.
      • getIsEnabled

        default java.util.function.BooleanSupplier getIsEnabled()
        Offers a way to tell if this panel is currently enabled or not. It's primarily used for permission panel to protect it from unauthorized changes.
        Returns:
        A BooleanSupplier that tells if this panel is currently enabled. Or null if the panel is always enabled.