java.lang.Object
qupath.fx.localization.LocaleManager
Manage available locales, with consistent display and string conversion.
This is useful to support presenting locales to a user for selection.
The implementation of this class assumes that the locales will always be shown to the user in the same language for consistency, which by default is US English. This can be changed by specifying a different base locale.
-
Constructor Summary
ConstructorDescriptionCreate a new locale manager using the default US base locale and considering locales identified by the JVM as being available.LocaleManager
(Predicate<Locale> availableLanguagePredicate) Create a new locale manager using the default US base locale and specified predicate to determine which locales should be available to the user, applied to the list of all locales identified by the JVM.LocaleManager
(Locale baseLocale, Predicate<Locale> availableLocalesPredicate) Create a new locale manager using the specified base locale and predicate to determine which locales should be available to the user, applied to the list of all locales identified by the JVM. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.collections.ObservableList<Locale>
Get an observable list of all locales identified by the JVM.javafx.collections.ObservableList<Locale>
Get an observable list of all locales identified by the JVM that match the current predicate.void
Refresh the list of available locales, based on the current predicate.
-
Constructor Details
-
LocaleManager
public LocaleManager()Create a new locale manager using the default US base locale and considering locales identified by the JVM as being available. -
LocaleManager
Create a new locale manager using the default US base locale and specified predicate to determine which locales should be available to the user, applied to the list of all locales identified by the JVM.- Parameters:
availableLanguagePredicate
-
-
LocaleManager
Create a new locale manager using the specified base locale and predicate to determine which locales should be available to the user, applied to the list of all locales identified by the JVM.- Parameters:
baseLocale
-availableLocalesPredicate
-
-
-
Method Details
-
getAllLocales
Get an observable list of all locales identified by the JVM.- Returns:
-
getAvailableLocales
Get an observable list of all locales identified by the JVM that match the current predicate.- Returns:
-
refreshAvailableLocales
public void refreshAvailableLocales()Refresh the list of available locales, based on the current predicate. This is useful if the application supports installing locales at runtime.
-