Interface ILocalizationViewModel<E extends ILocalizationViewModelEntry>

    • Method Detail

      • addNewLocale

        void addNewLocale()
        Adds a new locale to the list of localizations, using the current #getNewLanguageTag(); and clears the new language tag.
      • getActiveTabIndex

        int getActiveTabIndex()
        Gets the index of the tab of the selected locale, i.e. the index of the tab to display. Must be in the range of valid indices for the list of list of localizations.
        Returns:
        The index of the active tab.
      • setActiveTabIndex

        void setActiveTabIndex​(int activeTabIndex)
        Sets the index of the tab of the selected locale, i.e. the index of the tab to display. Must be in the range of valid indices for the list of list of localizations.
        Parameters:
        activeTabIndex - The index of the active tab.
      • getLocalizations

        List<E> getLocalizations()
        Gets the list of localizations, one entry for each locale.
        Returns:
        The map with the localized messages.
      • setLocalizations

        void setLocalizations​(List<E> localizations)
        Sets the list of localizations, one entry for each locale.
        Parameters:
        localizations - The map with the localized messages.
      • getLocalizationsByLocale

        E getLocalizationsByLocale​(Locale locale)
        Gets the list of localizations, one entry for each locale. Should create and return an empty entry if none exists for the given locale yet.
        Parameters:
        locale - The locale to get the entry for.
        Returns:
        The entry for the given locale.
      • getNewLanguageTag

        String getNewLanguageTag()
        Gets the tag of the new language that is to be added. This is not persisted, but only used in the UI.
        Returns:
        The tag of the new language.
      • setNewLanguageTag

        void setNewLanguageTag​(String newLanguageTag)
        Sets the tag of the new language that is to be added. This is not persisted, but only used in the UI.
        Parameters:
        newLanguageTag - The tag of the new language.
      • getTabTitle

        String getTabTitle​(E entry)
        Gets the title of the tab corresponding to the given localization entry.
        Parameters:
        entry - The entry for which to get the tab title.
        Returns:
        The tab title.
      • getViewLocale

        Locale getViewLocale()
        Sets the UI view locale for this view model. This locale is used for locale-sensitive operations, such as getting the display name of a locale.
        Returns:
        The view locale.
      • setViewLocale

        void setViewLocale​(Locale viewLocale)
        Sets the UI view locale for this view model. This locale is used for locale-sensitive operations, such as getting the display name of a locale.
        Parameters:
        viewLocale - The view locale.
      • removeLocale

        void removeLocale​(Locale locale)
        Removes a locale from the list of localizations.
        Parameters:
        locale - The locale to remove.