Package de.xima.fc.gui.common.model.data
Class ItemListModelSelectByView<T,ID>
- 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<T,ID>
-
- de.xima.fc.gui.common.model.data.ItemListModelSelectByView<T,ID>
-
- Type Parameters:
T- Type of the item.ID- Type of the item ID.
- All Implemented Interfaces:
IItemListModel<T>,IUpdatable,Serializable
- Direct Known Subclasses:
PromptConnectionListModel,PromptQueryListModel
public abstract class ItemListModelSelectByView<T,ID> extends ItemListModel<T,ID>
Extends theItemListModeland 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 theSelectionBeanfor storing the selection.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class de.xima.fc.gui.common.model.data.ItemListModel
all, filtered, globalFilter, hasAddNewEntity, LOG, marked, selected
-
-
Constructor Summary
Constructors Constructor Description ItemListModelSelectByView()ItemListModelSelectByView(EEntityKeySelectionType keyType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected Set<EViews>getAllowedViewsForSelection()Deprecated.CurrentViewBeangetCurrentViewBean()Deprecated.SelectionBeangetSelectionBean()protected abstract StringgetSelectionTypeKey()protected voidputSelectionToStore(SelectionBean selectionBean, String key, T selected)protected TreadSelectionFromStore(SelectionBean selectionBean, String key)protected TretrieveSelection()protected voidselectDefault()First attempts to retrieve the latest selection made by the user from theSelectionBean.voidsetSelected(T selected)After setting the selected entity to the given entity, stores this selection in theSelectionBean.protected voidstoreSelection(T selected)-
Methods inherited from class de.xima.fc.gui.common.model.data.ItemListModel
addMarked, addNew, castTo, create, crudCreate, crudDelete, crudRead, crudUpdate, delete, deleteEntity, deleteEntity, deleteMarkedEntities, fetchAll, findName, getAll, getAllPlusNew, getFiltered, getGlobalFilter, getId, getMarked, getNew, getSelected, hasEntity, isDetached, isEmptyList, isHasAddNewEntity, isMarkedDeletable, isNew, isPersisted, loadLazyData, onRowSelect, onRowSelectCheckbox, onRowUnselectCheckbox, onSelectionChanged, 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
-
-
-
-
Constructor Detail
-
ItemListModelSelectByView
public ItemListModelSelectByView()
-
ItemListModelSelectByView
public ItemListModelSelectByView(EEntityKeySelectionType keyType)
-
-
Method Detail
-
getCurrentViewBean
@Deprecated public CurrentViewBean getCurrentViewBean()
Deprecated.
-
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:
setSelectedin interfaceIItemListModel<T>- Overrides:
setSelectedin classItemListModel<T,ID>- Parameters:
selected- The model to be selected.
-
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.
-
getSelectionTypeKey
protected abstract String getSelectionTypeKey()
-
putSelectionToStore
protected void putSelectionToStore(SelectionBean selectionBean, String key, T selected)
-
readSelectionFromStore
protected T readSelectionFromStore(SelectionBean selectionBean, String key)
-
retrieveSelection
protected final T retrieveSelection()
-
selectDefault
protected void selectDefault()
First attempts to retrieve the latest selection made by the user from theSelectionBean. Uses the currentEViewsand, 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:
selectDefaultin classItemListModel<T,ID>
-
storeSelection
protected final void storeSelection(T selected)
-
-