Module qupath.fx

Class LocaleManager

java.lang.Object
qupath.fx.localization.LocaleManager

public class LocaleManager extends Object
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

    Constructors
    Constructor
    Description
    Create 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 Type
    Method
    Description
    javafx.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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public 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.
      Parameters:
      availableLanguagePredicate -
    • LocaleManager

      public 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.
      Parameters:
      baseLocale -
      availableLocalesPredicate -
  • Method Details

    • getAllLocales

      public javafx.collections.ObservableList<Locale> getAllLocales()
      Get an observable list of all locales identified by the JVM.
      Returns:
    • getAvailableLocales

      public javafx.collections.ObservableList<Locale> 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.