Package de.xima.fc.gui.model.form_theme
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.model.data.EntityListModel<T>
-
- de.xima.fc.gui.model.data.EntityListModelSelectByView<ClientFormTheme>
-
- de.xima.fc.gui.model.form_theme.FormThemeEditModeSimpleModel
-
- All Implemented Interfaces:
IEntityListModel<ClientFormTheme>
,IEntityListModelSelectByView<ClientFormTheme>
,IUpdatable
,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 toSIMPLE
. 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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class de.xima.fc.gui.model.data.EntityListModel
all, entityClass, filtered, globalFilter, hasAddNewEntity, marked, qcm, selected
-
-
Constructor Summary
Constructors Constructor Description FormThemeEditModeSimpleModel(IUser user, Mandant client, Locale locale)
Creates a new model for the client form themes in simple edit mode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNew()
Sets the currently selected model to a new model.void
close()
int
getFileTabsIndex()
Gets the active index of the tab view for the theme file tabs view.ClientFormTheme
getNew()
FormThemeEditModeSimpleSelectionModel
getSelectionModel()
Gets the model with additional data for the currently selected client form theme.void
loadLazyData()
Can be overriden to initialize lazily loaded fields on the entity.void
onSelected(ISerializableConsumer<ClientFormTheme> onSelected)
Sets the callback to invoke when the selection changed.void
recreateSelectionModel(ClientFormTheme clientFormTheme)
void
save()
Saves the currently selected model to the database.void
setFileTabsIndex(int fileTabsIndex)
Sets the active index of the tab view for the theme file tabs view.void
setSelected(ClientFormTheme clientFormTheme)
After setting the selected entity to the given entity, stores this selection in theSelectionBean
.-
Methods inherited from class de.xima.fc.gui.model.data.EntityListModelSelectByView
getAllowedViewsForSelection, getCurrentViewBean, getEntityClassKey, getSelectionBean, putSelectionToStore, readSelectionFromStore, retrieveSelection, selectDefault, storeSelection
-
Methods inherited from class de.xima.fc.gui.model.data.EntityListModel
addMarked, create, delete, delete, deleteEntity, deleteEntity, deleteMarkedEntities, ec, fetchAll, getAll, getAllPlusNew, getDao, getFiltered, getGlobalFilter, getMarked, getName, getSelected, hasEntity, isDetached, isEmptyList, isMarkedDeletable, isNew, onRowSelect, onRowSelectCheckbox, onRowUnselectCheckbox, onToggleSelect, performDelete, removeMarked, save, setFiltered, setGlobalFilter, setHasAddNewEntity, setMarked, setSelectedFromMarked, update, updateData, updateSelected
-
Methods inherited from class de.xima.fc.gui.common.utils.msg.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, msg
-
Methods inherited from class de.xima.fc.gui.common.utils.msg.I18nUtils
getFacesContext, getLocale, rbValue, rbValue, rbValue, rbValueOrDefault, rbValueOrDefault
-
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.gui.interfaces.data.IEntityListModel
addMarked, delete, delete, deleteEntity, deleteEntity, deleteMarkedEntities, getAll, getAllPlusNew, getFiltered, getMarked, getSelected, hasEntity, isEmptyList, isMarkedDeletable, isNew, onRowSelect, onRowSelectCheckbox, onRowUnselectCheckbox, onToggleSelect, removeMarked, setFiltered, setMarked, setSelectedFromMarked, updateSelected
-
Methods inherited from interface de.xima.fc.gui.interfaces.data.IUpdatable
updateData
-
-
-
-
Constructor Detail
-
FormThemeEditModeSimpleModel
public FormThemeEditModeSimpleModel(IUser user, Mandant client, Locale locale)
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 Detail
-
addNew
public void addNew()
Description copied from interface:IEntityListModel
Sets 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:
addNew
in interfaceIEntityListModel<ClientFormTheme>
- Overrides:
addNew
in classEntityListModel<ClientFormTheme>
-
close
public void close()
- Specified by:
close
in 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
public ClientFormTheme getNew()
- Overrides:
getNew
in classEntityListModel<ClientFormTheme>
-
getSelectionModel
public FormThemeEditModeSimpleSelectionModel 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:IEntityListModel
Can be overriden to initialize lazily loaded fields on the entity. By default, does not load any lazy data.- Specified by:
loadLazyData
in interfaceIEntityListModel<ClientFormTheme>
- Overrides:
loadLazyData
in classEntityListModel<ClientFormTheme>
-
onSelected
public void onSelected(ISerializableConsumer<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
public void recreateSelectionModel(ClientFormTheme clientFormTheme)
-
save
public void save()
Description copied from interface:IEntityListModel
Saves the currently selected model to the database. If itIEntityListModel.isNew()
, creates a new entry in the database, otherwise updates the existing entry.- Specified by:
save
in interfaceIEntityListModel<ClientFormTheme>
- Overrides:
save
in classEntityListModel<ClientFormTheme>
-
setSelected
public void setSelected(ClientFormTheme clientFormTheme)
Description copied from class:EntityListModelSelectByView
After 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:
setSelected
in interfaceIEntityListModel<ClientFormTheme>
- Overrides:
setSelected
in classEntityListModelSelectByView<ClientFormTheme>
- Parameters:
clientFormTheme
- The model to be selected.
-
-