Package de.xima.fc.common.bean_models
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 ofILocalizationViewModelthat allows for a custom source of localization entries, but POJO implementation for the remaining view related data.- Since:
- 8.2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SourceableLocalizationViewModel()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddNewLocale()Adds a new locale to the list of localizations, using the current #getNewLanguageTag(); and clears the new language tag.intgetActiveTabIndex()Gets the index of the tab of the selected locale, i.e.EgetLocalizationsByLocale(Locale locale)Gets the list of localizations, one entry for each locale.StringgetNewLanguageTag()Gets the tag of the new language that is to be added.LocalegetSelectedLocale()StringgetTabTitle(E entry)Gets the title of the tab corresponding to the given localization entry.LocalegetViewLocale()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.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.common.bean_models.ILocalizationViewModel
getLocalizations, setLocalizations
-
-
-
-
Method Detail
-
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
public E getLocalizationsByLocale(Locale locale)
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
public String 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
public void setNewLanguageTag(String newLanguageTag)
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
public Locale getSelectedLocale()
-
setSelectedLocale
public void setSelectedLocale(Locale selectedLocale)
-
getTabTitle
public String getTabTitle(E entry)
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
public Locale 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
public void setViewLocale(Locale viewLocale)
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
public void removeLocale(Locale locale)
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
protected abstract E newEntry()
-
-