Skip to content

UserPreferencesManager Class

Natalie L edited this page Dec 5, 2024 · 1 revision

UserPreferencesManager Class

The UserPreferencesManager class is part of the services package (package org.example.globalgoodsindex.services) . It manages user preferences for settings such as theme and language. The class uses java.util.prefs.Preferences to store and retrieve preferences locally.

The Preferences API provides a simple way to store application settings in a platform-independent manner.

Methods

saveTheme

  • Stores the selected theme name in the system's preferences using the THEME_KEY.

getTheme

  • Retrieves the stored theme using the THEME_KEY. Defaults to 'PrimerLight' if no theme is saved.

saveLanguage

  • Stores the selected language in the system's preferences using the LANGUAGE_KEY.

getTheme

  • Retrieves the stored language using the LANGUAGE_KEY. Defaults to 'English' if no language is saved.

Clone this wiki locally