SettingsComponent

abstract class SettingsComponent<S : Settings<S, T>, T : Scheme<T>>(settings: S) : SettingsManager<S>

A component that allows the user to edit settings and its corresponding schemes.

Subclasses MUST call loadSettings in their constructor.

There are multiple settings S instances at any time. The settings given in the constructor is read when the component is created and is written to when the user saves its changes. The currently-selected scheme is loaded into the component's inputs. When the user selects a different scheme of which to change its values, the values in the input fields are stored in a copy of settings. This way, the local changes are not lost when switching between schemes, and the user can still revert all unsaved changes if desired.

Parameters

S

the type of settings to manage

T

the type of scheme to manage

settings

the settings to manage

Constructors

SettingsComponent
Link copied to clipboard
fun <S : Settings<S, T>> SettingsComponent(settings: S)
the type of settings to manage

Functions

doValidate
Link copied to clipboard
abstract fun doValidate(): ValidationInfo?
Validates all input fields.
isModified
Link copied to clipboard
fun isModified(): Boolean
Returns true if this component contains unsaved changes.
open fun isModified(settings: S): Boolean
Returns true if this component contains unsaved changes.
loadScheme
Link copied to clipboard
abstract fun loadScheme(scheme: T)
Loads the given scheme into the component's state.
loadSettings
Link copied to clipboard
override fun loadSettings()
Loads the default settings object.
override fun loadSettings(settings: S)
Loads settings.
reset
Link copied to clipboard
fun reset()
Discards unsaved changes.
saveScheme
Link copied to clipboard
abstract fun saveScheme(scheme: T)
Saves the component's state into the given scheme.
saveSettings
Link copied to clipboard
override fun saveSettings()
Saves settings to the default settings object.
override fun saveSettings(settings: S)
Saves settings to settings.

Properties

rootPane
Link copied to clipboard
abstract val rootPane: JPanel?
The panel containing the settings.
schemesPanel
Link copied to clipboard
abstract val schemesPanel: SchemesPanel<T>
The panel containing the dropdown box of schemes and action buttons to rename, delete, etc.
unsavedSettings
Link copied to clipboard
abstract val unsavedSettings: S
The local copy that represents the currently-unsaved settings that are being edited by the user.

Inheritors

ArraySettingsComponent
Link copied to clipboard
DecimalSettingsComponent
Link copied to clipboard
IntegerSettingsComponent
Link copied to clipboard
StringSettingsComponent
Link copied to clipboard
UuidSettingsComponent
Link copied to clipboard
WordSettingsComponent
Link copied to clipboard

Sources

jvm source
Link copied to clipboard