Package de.xima.fc.gui.model.data
Class EntityListModelSelectByView<T extends ITransferableEntity>
- 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<T>
-
- Type Parameters:
T
- the entity type
- All Implemented Interfaces:
IEntityListModel<T>
,IEntityListModelSelectByView<T>
,IUpdatable
,Serializable
- Direct Known Subclasses:
AppointmentTemplateListModel
,ClientBean.EntityListModelImpl
,ClientCounterConfigBean.EntityListModelImpl
,ClientResourceBean.EntityListModelImpl
,DataSourcesBean.EntityListModelImpl
,DbConnectionBean.EntityListModelImpl
,DbQueryBean.EntityListModelImpl
,FrontendServerBean.EntityListModelImpl
,InboxBean.EntityListModelImpl
,LdapConnectionBean.EntityListModelImpl
,LDAPGroupBean.EntityListModelImpl
,LdapQueryBean.EntityListModelImpl
,MandantFrontendServerBean.EntityListModelImpl
,ProjectResourceBean.EntityListModelImpl
,TemplatesBean.EntityListModelImpl
,UserBean.EntityListModelImpl
,UserGroupBean.EntityListModelImpl
,UserRoleBean.EntityListModelImpl
public class EntityListModelSelectByView<T extends ITransferableEntity> extends EntityListModel<T> implements IEntityListModelSelectByView<T>
Extends theEntityListModel
and adds functionality for memorizing the currently selected entity for the duration of the current session. When the user revisits a view, the previous selection is restored. Uses theSelectionBean
for storing the selection.- 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 EntityListModelSelectByView(Class<T> entityClass, de.xima.cmn.criteria.QueryCriteriaManager qcm)
EntityListModelSelectByView(Class<T> entityClass, de.xima.cmn.criteria.QueryCriteriaManager qcm, EEntityKeySelectionType keyType)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected Set<EViews>
getAllowedViewsForSelection()
Deprecated.CurrentViewBean
getCurrentViewBean()
Deprecated.String
getEntityClassKey()
SelectionBean
getSelectionBean()
protected void
putSelectionToStore(SelectionBean selectionBean, String key, T selected)
protected T
readSelectionFromStore(SelectionBean selectionBean, String key)
protected T
retrieveSelection()
protected void
selectDefault()
First attempts to retrieve the latest selection made by the user from theSelectionBean
.void
setSelected(T selected)
After setting the selected entity to the given entity, stores this selection in theSelectionBean
.protected void
storeSelection(T selected)
-
Methods inherited from class de.xima.fc.gui.model.data.EntityListModel
addMarked, addNew, create, delete, delete, deleteEntity, deleteEntity, deleteMarkedEntities, ec, fetchAll, getAll, getAllPlusNew, getDao, getFiltered, getGlobalFilter, getMarked, getName, getNew, getSelected, hasEntity, isDetached, isEmptyList, isMarkedDeletable, isNew, loadLazyData, onRowSelect, onRowSelectCheckbox, onRowUnselectCheckbox, onToggleSelect, performDelete, removeMarked, save, 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, addNew, delete, delete, deleteEntity, deleteEntity, deleteMarkedEntities, getAll, getAllPlusNew, getFiltered, getMarked, getSelected, hasEntity, isEmptyList, isMarkedDeletable, isNew, loadLazyData, onRowSelect, onRowSelectCheckbox, onRowUnselectCheckbox, onToggleSelect, removeMarked, save, setFiltered, setMarked, setSelectedFromMarked, updateSelected
-
Methods inherited from interface de.xima.fc.gui.interfaces.data.IUpdatable
updateData
-
-
-
-
Constructor Detail
-
EntityListModelSelectByView
public EntityListModelSelectByView(Class<T> entityClass, de.xima.cmn.criteria.QueryCriteriaManager qcm)
-
EntityListModelSelectByView
public EntityListModelSelectByView(Class<T> entityClass, de.xima.cmn.criteria.QueryCriteriaManager qcm, EEntityKeySelectionType keyType)
-
-
Method Detail
-
getCurrentViewBean
@Deprecated public CurrentViewBean getCurrentViewBean()
Deprecated.
-
getEntityClassKey
public String getEntityClassKey()
- Specified by:
getEntityClassKey
in interfaceIEntityListModelSelectByView<T extends ITransferableEntity>
- Returns:
- Value for the entity class in
SelectionBean.storeEntityIdFromUrl(EEntityKeySelectionType, String)
-
getSelectionBean
public SelectionBean getSelectionBean()
-
setSelected
public void setSelected(T selected)
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<T extends ITransferableEntity>
- Overrides:
setSelected
in classEntityListModel<T extends ITransferableEntity>
- Parameters:
selected
- The model to be selected.
-
readSelectionFromStore
protected T readSelectionFromStore(SelectionBean selectionBean, String key)
-
getAllowedViewsForSelection
@Deprecated protected Set<EViews> getAllowedViewsForSelection()
Deprecated.- Returns:
- A set of views for which pre-selection (
selectDefault()
) is allowed for this model. If empty, no restriction is applied.
-
selectDefault
protected void selectDefault()
First attempts to retrieve the latest selection made by the user from theSelectionBean
. Uses the currentEViews
and, if applicable, current client and project as the key for storing and retrieving the selected entity (ID). This pre-selection is restricted to thegetAllowedViewsForSelection()
. If no selection can be found, lets the super class choose a default selection.- Overrides:
selectDefault
in classEntityListModel<T extends ITransferableEntity>
-
retrieveSelection
protected final T retrieveSelection()
-
storeSelection
protected final void storeSelection(T selected)
-
putSelectionToStore
protected void putSelectionToStore(SelectionBean selectionBean, String key, T selected)
-
-