Package org.apache.log4j.chainsaw
Class ApplicationPreferenceModelSaver
- java.lang.Object
-
- org.apache.log4j.chainsaw.ApplicationPreferenceModelSaver
-
- All Implemented Interfaces:
java.util.EventListener
,SettingsListener
public class ApplicationPreferenceModelSaver extends java.lang.Object implements SettingsListener
Helper class that helps delegate the work of loading and saving the values of the ApplicationPreferenceModel, allowing that class to remain a simple bean.The Model passed to this class' constructor is the instance of the ApplicationPreference that will be saved, and will have properties modified by loading from the 'chainsaw.settings.xml' file in the .chainsaw directory of the user's home directory.
-
-
Field Summary
Fields Modifier and Type Field Description private ApplicationPreferenceModel
model
-
Constructor Summary
Constructors Constructor Description ApplicationPreferenceModelSaver(ApplicationPreferenceModel model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.io.File
getApplicationPreferenceXMLFile(java.io.File settingsLocation)
void
loadSettings(LoadSettingsEvent event)
When a request to load Settings has been requested, this method will be invoked by the SettingsManager.void
saveSettings(SaveSettingsEvent event)
-
-
-
Field Detail
-
model
private final ApplicationPreferenceModel model
-
-
Constructor Detail
-
ApplicationPreferenceModelSaver
public ApplicationPreferenceModelSaver(ApplicationPreferenceModel model)
- Parameters:
model
-
-
-
Method Detail
-
loadSettings
public void loadSettings(LoadSettingsEvent event)
Description copied from interface:SettingsListener
When a request to load Settings has been requested, this method will be invoked by the SettingsManager. The implementing component can query the event for settings, and modify it's internal state based on these settings.- Specified by:
loadSettings
in interfaceSettingsListener
-
saveSettings
public void saveSettings(SaveSettingsEvent event)
- Specified by:
saveSettings
in interfaceSettingsListener
-
getApplicationPreferenceXMLFile
private java.io.File getApplicationPreferenceXMLFile(java.io.File settingsLocation)
-
-