Class FormThemeEditModeSimpleModel
java.lang.Object
de.xima.fc.gui.common.utils.msg.I18nUtils
de.xima.fc.gui.common.utils.msg.MessageUtils
de.xima.fc.gui.common.utils.msg.AMessaging
de.xima.fc.gui.common.model.data.ItemListModel<ClientFormTheme, Long>
de.xima.fc.gui.model.data.EntityListModel<ClientFormTheme>
de.xima.fc.gui.model.data.EntityListModelSelectByView<ClientFormTheme>
de.xima.fc.gui.model.form_theme.FormThemeEditModeSimpleModel
- All Implemented Interfaces:
IItemListModel<ClientFormTheme>, IUpdatable, IEntityListModel<ClientFormTheme>, IEntityListModelSelectByView<ClientFormTheme>, Serializable, AutoCloseable
public final class FormThemeEditModeSimpleModel
extends EntityListModelSelectByView<ClientFormTheme>
implements AutoCloseable
Implementation of the list model for the client form themes, when the edit mode is set to
SIMPLE. In simple edit mode, the user sees a list of client form themes. They can
select a theme to edit it. The user can also create a new theme.- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Field Summary
Fields inherited from class EntityListModel
entityClass, qcmFields inherited from class ItemListModel
all, filtered, globalFilter, hasAddNewEntity, LOG, marked, selected -
Constructor Summary
ConstructorsConstructorDescriptionFormThemeEditModeSimpleModel(IUser user, Mandant client, Locale locale) Creates a new model for the client form themes in simple edit mode. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNew()Sets the currently selected model to a new model.voidclose()intGets the active index of the tab view for the theme file tabs view.getNew()Gets the model with additional data for the currently selected client form theme.voidCan be overridden to initialize lazily loaded fields on the entity.voidonSelected(ISerializableConsumer<ClientFormTheme> onSelected) Sets the callback to invoke when the selection changed.voidrecreateSelectionModel(ClientFormTheme clientFormTheme) voidsave()Saves the currently selected model to the database.voidsetFileTabsIndex(int fileTabsIndex) Sets the active index of the tab view for the theme file tabs view.voidsetSelected(ClientFormTheme clientFormTheme) After setting the selected entity to the given entity, stores this selection in theSelectionBean.Methods inherited from class EntityListModelSelectByView
getAllowedViewsForSelection, getCurrentViewBean, getEntityClassKey, getSelectionBean, putSelectionToStore, readSelectionFromStore, retrieveSelection, selectDefault, storeSelectionMethods inherited from class EntityListModel
addMarked, castTo, create, crudCreate, crudDelete, crudRead, crudUpdate, delete, delete, deleteEntity, deleteEntity, deleteMarkedEntities, ec, fetchAll, findName, getAll, getAllPlusNew, getDao, getFiltered, getGlobalFilter, getId, getMarked, getName, getSelected, hasEntity, isDetached, isDetached, isEmptyList, isHasAddNewEntity, isMarkedDeletable, isNew, isPersisted, onRowSelect, onRowSelectCheckbox, onRowUnselectCheckbox, onSelectionChanged, onToggleSelect, performDelete, removeMarked, save, setFiltered, setGlobalFilter, setHasAddNewEntity, setMarked, setSelectedFromMarked, update, updateData, updateSelectedMethods inherited from class MessageUtils
addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsgFromString, addErrorMsgFromString, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addInfoMsg, addInfoMsg, addInfoMsg, addInfoMsg, addInfoMsgFromString, addInfoMsgFromString, addInfoMsgToComponent, addInfoMsgToComponent, addInfoMsgToComponent, addInfoMsgToComponent, addMsg, addMsg, addMsg, addMsg, addMsgs, addMsgs, addMsgToComponent, addMsgToComponent, addWarnMsg, addWarnMsg, addWarnMsg, addWarnMsg, addWarnMsgFromString, addWarnMsgFromString, addWarnMsgToComponent, addWarnMsgToComponent, addWarnMsgToComponent, addWarnMsgToComponent, cleanErrorMsg, errorMsg, errorMsg, getErrorMessage, getNewErrorMsg, getNewErrorMsg, getNewErrorMsg, getNewInfoMsg, getNewInfoMsg, getNewMsg, getNewWarnMsg, getNewWarnMsg, msgMethods inherited from class I18nUtils
getFacesContext, getLocale, rbValue, rbValue, rbValue, rbValueOrDefault, rbValueOrDefaultMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IEntityListModel
addMarked, delete, delete, deleteEntity, deleteEntity, deleteMarkedEntities, getAll, getAllPlusNew, getFiltered, getMarked, getSelected, hasEntity, isEmptyList, isMarkedDeletable, isNew, onRowSelect, onRowSelectCheckbox, onRowUnselectCheckbox, onToggleSelect, removeMarked, setFiltered, setMarked, setSelectedFromMarked, updateSelectedMethods inherited from interface IUpdatable
updateData
-
Constructor Details
-
FormThemeEditModeSimpleModel
Creates a new model for the client form themes in simple edit mode. Reads all client form themes from the given client.- Parameters:
user- The user that is currently logged in.client- The client for which the form themes are loaded.locale- The locale for localization e.g. error messages.
-
-
Method Details
-
addNew
public void addNew()Description copied from interface:IItemListModelSets the currently selected model to a new model. A new model is not yet persisted in the database and exists only in memory.- Specified by:
addNewin interfaceIEntityListModel<ClientFormTheme>- Specified by:
addNewin interfaceIItemListModel<ClientFormTheme>- Overrides:
addNewin classEntityListModel<ClientFormTheme>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getFileTabsIndex
public int getFileTabsIndex()Gets the active index of the tab view for the theme file tabs view.- Returns:
- The active theme file tabs view index.
-
setFileTabsIndex
public void setFileTabsIndex(int fileTabsIndex) Sets the active index of the tab view for the theme file tabs view.- Parameters:
fileTabsIndex- The active theme file tabs view index.
-
getNew
- Overrides:
getNewin classEntityListModel<ClientFormTheme>
-
getSelectionModel
Gets the model with additional data for the currently selected client form theme.- Returns:
- Additional data for the currently selected client form theme, null if no theme is selected.
-
loadLazyData
public void loadLazyData()Description copied from interface:IItemListModelCan be overridden to initialize lazily loaded fields on the entity. By default, does not load any lazy data.- Specified by:
loadLazyDatain interfaceIEntityListModel<ClientFormTheme>- Specified by:
loadLazyDatain interfaceIItemListModel<ClientFormTheme>- Overrides:
loadLazyDatain classEntityListModel<ClientFormTheme>
-
onSelected
Sets the callback to invoke when the selection changed. Overrides previously set callbacks.- Parameters:
onSelected- The callback to invoke when the selection changed.
-
recreateSelectionModel
-
save
public void save()Description copied from interface:IItemListModelSaves the currently selected model to the database. If itIItemListModel.isNew(), creates a new entry in the database, otherwise updates the existing entry.- Specified by:
savein interfaceIEntityListModel<ClientFormTheme>- Specified by:
savein interfaceIItemListModel<ClientFormTheme>- Overrides:
savein classEntityListModel<ClientFormTheme>
-
setSelected
Description copied from class:EntityListModelSelectByViewAfter setting the selected entity to the given entity, stores this selection in theSelectionBean. This allows the selection to be restored when the user revisits the page (during the same session).- Specified by:
setSelectedin interfaceIEntityListModel<ClientFormTheme>- Specified by:
setSelectedin interfaceIItemListModel<ClientFormTheme>- Overrides:
setSelectedin classEntityListModelSelectByView<ClientFormTheme>- Parameters:
clientFormTheme- The model to be selected.
-