Class SourceableLocalizationViewModel<E extends ILocalizationViewModelEntry>
java.lang.Object
de.xima.fc.common.bean_models.SourceableLocalizationViewModel<E>
- All Implemented Interfaces:
ILocalizationViewModel<E>, Serializable
- Direct Known Subclasses:
PojoLocalizationViewModel
public abstract class SourceableLocalizationViewModel<E extends ILocalizationViewModelEntry>
extends Object
implements ILocalizationViewModel<E>
Base implementation of
ILocalizationViewModel that allows for a custom source of localization entries, but
POJO implementation for the remaining view related data.- Since:
- 8.2.0
- See Also:
-
Constructor Summary
Constructors -
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.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.protected abstract EnewEntry()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.voidsetNewLanguageTag(String newLanguageTag) Sets the tag of the new language that is to be added.voidsetSelectedLocale(Locale selectedLocale) voidsetViewLocale(Locale viewLocale) Sets the UI view locale for this view model.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ILocalizationViewModel
getLocalizations, setLocalizations
-
Constructor Details
-
SourceableLocalizationViewModel
public SourceableLocalizationViewModel()
-
-
Method Details
-
addNewLocale
public void addNewLocale()Description copied from interface:ILocalizationViewModelAdds a new locale to the list of localizations, using the current #getNewLanguageTag(); and clears the new language tag.- Specified by:
addNewLocalein interfaceILocalizationViewModel<E extends ILocalizationViewModelEntry>
-
getActiveTabIndex
public int getActiveTabIndex()Description copied from interface:ILocalizationViewModelGets 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.- Specified by:
getActiveTabIndexin interfaceILocalizationViewModel<E extends ILocalizationViewModelEntry>- Returns:
- The index of the active tab.
-
setActiveTabIndex
public void setActiveTabIndex(int activeTabIndex) Description copied from interface:ILocalizationViewModelSets 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.- Specified by:
setActiveTabIndexin interfaceILocalizationViewModel<E extends ILocalizationViewModelEntry>- Parameters:
activeTabIndex- The index of the active tab.
-
getLocalizationsByLocale
Description copied from interface:ILocalizationViewModelGets the list of localizations, one entry for each locale. Should create and return an empty entry if none exists for the given locale yet.- Specified by:
getLocalizationsByLocalein interfaceILocalizationViewModel<E extends ILocalizationViewModelEntry>- Parameters:
locale- The locale to get the entry for.- Returns:
- The entry for the given locale.
-
getNewLanguageTag
Description copied from interface:ILocalizationViewModelGets the tag of the new language that is to be added. This is not persisted, but only used in the UI.- Specified by:
getNewLanguageTagin interfaceILocalizationViewModel<E extends ILocalizationViewModelEntry>- Returns:
- The tag of the new language.
-
setNewLanguageTag
Description copied from interface:ILocalizationViewModelSets the tag of the new language that is to be added. This is not persisted, but only used in the UI.- Specified by:
setNewLanguageTagin interfaceILocalizationViewModel<E extends ILocalizationViewModelEntry>- Parameters:
newLanguageTag- The tag of the new language.
-
getSelectedLocale
-
setSelectedLocale
-
getTabTitle
Description copied from interface:ILocalizationViewModelGets the title of the tab corresponding to the given localization entry.- Specified by:
getTabTitlein interfaceILocalizationViewModel<E extends ILocalizationViewModelEntry>- Parameters:
entry- The entry for which to get the tab title.- Returns:
- The tab title.
-
getViewLocale
Description copied from interface:ILocalizationViewModelSets 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.- Specified by:
getViewLocalein interfaceILocalizationViewModel<E extends ILocalizationViewModelEntry>- Returns:
- The view locale.
-
setViewLocale
Description copied from interface:ILocalizationViewModelSets 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.- Specified by:
setViewLocalein interfaceILocalizationViewModel<E extends ILocalizationViewModelEntry>- Parameters:
viewLocale- The view locale.
-
removeLocale
Description copied from interface:ILocalizationViewModelRemoves a locale from the list of localizations.- Specified by:
removeLocalein interfaceILocalizationViewModel<E extends ILocalizationViewModelEntry>- Parameters:
locale- The locale to remove.
-
newEntry
-