Interface ILocalizationViewModel<E extends ILocalizationViewModelEntry>
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultLocalizationViewModel, EndUserStateLocalizationViewModel, PojoLocalizationViewModel, SourceableLocalizationViewModel
UI view model that lets the user edit localizable messages for potentially arbitrary languages and message keys.
- Since:
- 8.2.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new locale to the list of localizations, using the current #getNewLanguageTag(); and clears the new language tag.intGets the index of the tab of the selected locale, i.e. the index of the tab to display.Gets the list of localizations, one entry for each locale.getLocalizationsByLocale(Locale locale) Gets the list of localizations, one entry for each locale.Gets the tag of the new language that is to be added.getTabTitle(E entry) Gets the title of the tab corresponding to the given localization entry.Sets the UI view locale for this view model.voidremoveLocale(Locale locale) Removes a locale from the list of localizations.voidsetActiveTabIndex(int activeTabIndex) Sets the index of the tab of the selected locale, i.e. the index of the tab to display.voidsetLocalizations(List<E> localizations) Sets the list of localizations, one entry for each locale.voidsetNewLanguageTag(String newLanguageTag) Sets the tag of the new language that is to be added.voidsetViewLocale(Locale viewLocale) Sets the UI view locale for this view model.
-
Method Details
-
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 oflist 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 oflist of localizations.- Parameters:
activeTabIndex- The index of the active tab.
-
getLocalizations
-
setLocalizations
-
getLocalizationsByLocale
-
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
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
-
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
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
Removes a locale from the list of localizations.- Parameters:
locale- The locale to remove.
-