Package org.cesilko.rachota.core
Class Settings
java.lang.Object
org.cesilko.rachota.core.Settings
Persistent settings of the system.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Activity not yet reported.static final String
Tried to report activity but failed.static final String
Static String used to store the daily working hours field.static final String
On exit, ask for measuring downtime.static final String
On exit, stop measuring downtime.static String
Flag to ask user if hibernation was detected.static String
Flag to ignore downtime if hibernation was detected.static String
Flag to include downtime if hibernation was detected.static final String
On inactivity, ask user what to do next.static final String
On inactivity, only notify user.static final String
On inactivity, stop measuring current task. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds new listener to set of objects interested in this settings.static Settings
Returns the only instance of persistent system settings.getSetting
(String setting) Returns value of given setting.double
Returns the daily working hours.static void
Loads all settings from settings.cfg file.void
Adds new listener to set of objects interested in this settings.static void
Saves all settings into settings.cfg file.void
setSetting
(String setting, Object value) Sets given setting to given value.void
setWorkingHours
(double value) Sets the daily working hours.
-
Field Details
-
ON_HIBERNATION_IGNORE
Flag to ignore downtime if hibernation was detected. -
ON_HIBERNATION_INCLUDE
Flag to include downtime if hibernation was detected. -
ON_HIBERNATION_ASK
Flag to ask user if hibernation was detected. -
ON_EXIT_ASK
On exit, ask for measuring downtime.- See Also:
-
ON_EXIT_STOP
On exit, stop measuring downtime.- See Also:
-
ON_INACTIVITY_NOTIFY
On inactivity, only notify user.- See Also:
-
ON_INACTIVITY_ASK
On inactivity, ask user what to do next.- See Also:
-
ON_INACTIVITY_STOP
On inactivity, stop measuring current task.- See Also:
-
ACTIVITY_REPORT_FAILED
Tried to report activity but failed.- See Also:
-
ACTIVITY_NOT_REPORTED
Activity not yet reported.- See Also:
-
DAY_WORKING_HOURS
Static String used to store the daily working hours field.- See Also:
-
-
Method Details
-
getDefault
Returns the only instance of persistent system settings.- Returns:
- Persistent system settings.
-
setSetting
Sets given setting to given value.- Parameters:
setting
- Setting to be set.value
- New value of setting.
-
getSetting
Returns value of given setting.- Parameters:
setting
- Setting whose value will be returned.- Returns:
- Value of given setting or null if it does not exist.
-
addPropertyChangeListener
Adds new listener to set of objects interested in this settings.- Parameters:
listener
- Object interested in this settings.
-
removePropertyChangeListener
Adds new listener to set of objects interested in this settings.- Parameters:
listener
- Object interested in this settings.
-
saveSettings
public static void saveSettings()Saves all settings into settings.cfg file. -
loadSettings
public static void loadSettings()Loads all settings from settings.cfg file. -
getWorkingHours
public double getWorkingHours()Returns the daily working hours.- Returns:
- The daily working hours.
-
setWorkingHours
public void setWorkingHours(double value) Sets the daily working hours.- Parameters:
value
- The new value for the daily working hours.
-