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,HelpUtilPreferencesPanel,JmriSRCPServerPreferencesPanel,JmrixConfigPane,JsonServerPreferencesPanel,LnTcpPreferencesPanel,LoadAndStorePreferencesPanel,LogixNGPreferencesPanel,ManagerDefaultsConfigPane,OperationsPreferencesPanel,OperationsSettingsPanel,OptionPanel,PermissionPreferencesPanel,PreferencesPane,PrintMoreOptionPanel,PrintOptionPanel,ProfilePreferencesPanel,ProgrammerConfigPane,RailroadNamePreferencesPanel,RosterConfigPane,ShutdownPreferencesPanel,SimpleServerPreferencesPanel,StartupActionsPreferencesPanel,StreamConfigPane,SystemConsoleConfigPanel,ThrottlesPreferencesPane,UserMessagePreferencesPane,WarrantPreferencesPanel,WebServerPreferencesPanel,WiThrottlePrefsPanel
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 TypeMethodDescriptiondefault BooleanSupplierOffers a way to tell if this panel is currently enabled or not.Text displayed above the preferences panel This label is only displayed if the preferences panel is in a tabbed set of preferences.Get the preferences component for displayGet the Preferences Item identifier.Get the text for the Preferences Item in the preferences window list of preferences categories.The tooltip to display for a tabbed preferences paneldefault intIndicate the sort order to be used to sort PreferencesPanels in TabbedPreferences.Get the title for the tab containing this preferences item.booleanisDirty()Indicate that preferences need to be saved.booleanIndicates that this PrefernecesPanel should be stored across application starts by the PreferencesManager This should be true if the implementing class relies on theConfigureManagerstores and retrieves the preferences managed by the implementing class on behalf of the implementing class.booleanIndicate that the preferences are valid.booleanIndicate that the preferences will not take effect until restarted.voidSave 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 theConfigureManagerstores 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
void savePreferences()Save any changes to preferences. This method is called for every instance of a PreferencesPanel that is loaded byTabbedPreferencesifisPersistant()is false. -
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
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
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.
-