Package org.apache.log4j.chainsaw.prefs
Class SettingsManager
java.lang.Object
org.apache.log4j.chainsaw.prefs.SettingsManager
SettingManager allows components to register interest in Saving/Loading
of general application preferences/settings.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Properties
private static final String
private static final String
private static final SettingsManager
private EventListenerList
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Initialises the SettingsManager by loading the default Properties from a resource -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSettingsListener
(SettingsListener listener) Registers the listener with the managervoid
configure
(SettingsListener listener) private LoadSettingsEvent
Returns the loaded default settings, which can be used by other classes within this package.static SettingsManager
Returns the singleton instance of the SettingsManagerprivate Properties
Returns the current Properties settings for this user by merging the default Properties with the ones we find in their directory.private void
private void
private void
private Properties
void
Requests that the settings be loaded, all listeners will be notified of this call, and configure themselves according to the values found in the loaded settingsprivate void
saveGlobalSettings
(File settingsDir) private void
saveProfileableSetting
(File settingsDir) Looks up all the Profileable's that have been registered and creates a new event for each of them, and ensures that they are saved within a separate external storevoid
Creates a SaveSettingsEvent and calls all the SettingsListeners to populate the properties with configuration information
-
Field Details
-
instance
-
GLOBAL_SETTINGS_FILE_NAME
- See Also:
-
HEADER
- See Also:
-
listenerList
-
defaultProperties
-
-
Constructor Details
-
SettingsManager
private SettingsManager()Initialises the SettingsManager by loading the default Properties from a resource
-
-
Method Details
-
getInstance
Returns the singleton instance of the SettingsManager- Returns:
- settings manager
-
addSettingsListener
Registers the listener with the manager- Parameters:
listener
-
-
loadSettings
public void loadSettings()Requests that the settings be loaded, all listeners will be notified of this call, and configure themselves according to the values found in the loaded settings -
loadProfileableSettings
private void loadProfileableSettings() -
loadProfileble
-
createProfilebleEvent
-
loadProperties
- Parameters:
p
-- Returns:
-
loadGlobalSettings
private void loadGlobalSettings() -
saveSettings
public void saveSettings()Creates a SaveSettingsEvent and calls all the SettingsListeners to populate the properties with configuration information -
saveProfileableSetting
Looks up all the Profileable's that have been registered and creates a new event for each of them, and ensures that they are saved within a separate external store- Parameters:
settingsDir
-
-
saveGlobalSettings
-
getSettingsDirectory
-
configure
-
loadGlobalProperties
Returns the current Properties settings for this user by merging the default Properties with the ones we find in their directory.- Returns:
-
getDefaultSettings
Returns the loaded default settings, which can be used by other classes within this package.- Returns:
- Properties defaults
-