Package de.xima.fc.prompt.mgmt.gui.model
Class PromptQueryListModel
- 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<PromptQueryViewModel,UUID>
-
- de.xima.fc.prompt.mgmt.gui.model.PromptQueryListModel
-
- All Implemented Interfaces:
IItemListModel<PromptQueryViewModel>,IUpdatable,Serializable
public final class PromptQueryListModel extends ItemListModelSelectByView<PromptQueryViewModel,UUID>
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class de.xima.fc.gui.common.model.data.ItemListModel
all, filtered, globalFilter, hasAddNewEntity, marked, selected
-
-
Constructor Summary
Constructors Constructor Description PromptQueryListModel(PromptQueryBeanEnvironment environment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNew()Sets the currently selected model to a new model.protected PromptQueryViewModelcrudCreate(PromptQueryViewModel item)protected voidcrudDelete(PromptQueryViewModel item)protected PromptQueryViewModelcrudRead(UUID uuid)protected PromptQueryViewModelcrudUpdate(PromptQueryViewModel item)protected List<PromptQueryViewModel>fetchAll()Fetches all available entities.protected StringfindName(PromptQueryViewModel item)protected UUIDgetId(PromptQueryViewModel item)protected PromptQueryViewModelgetNew()protected StringgetSelectionTypeKey()PromptQueryTestViewModelgetTestModel()protected booleanisDetached(PromptQueryViewModel item)protected booleanisPersisted(PromptQueryViewModel item)protected voidonSelectionChanged(PromptQueryViewModel newSelected)Called when the selection changes, e.g. when a new item is selected or the selection is cleared.voidrefreshSelectionModel(boolean reload)Refreshes the selection model for the currently selected query.PromptQuerySelectionModel<?,?>selectionModel()PromptQueryTestViewModelupdateTestModel()-
Methods inherited from class de.xima.fc.gui.common.model.data.ItemListModelSelectByView
getAllowedViewsForSelection, getCurrentViewBean, getSelectionBean, putSelectionToStore, readSelectionFromStore, retrieveSelection, selectDefault, setSelected, storeSelection
-
Methods inherited from class de.xima.fc.gui.common.model.data.ItemListModel
addMarked, castTo, create, delete, deleteEntity, deleteEntity, deleteMarkedEntities, getAll, getAllPlusNew, getFiltered, getGlobalFilter, getMarked, getSelected, hasEntity, isEmptyList, isHasAddNewEntity, 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
-
-
-
-
Constructor Detail
-
PromptQueryListModel
public PromptQueryListModel(PromptQueryBeanEnvironment environment)
-
-
Method Detail
-
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 interfaceIItemListModel<PromptQueryViewModel>- Overrides:
addNewin classItemListModel<PromptQueryViewModel,UUID>
-
getTestModel
public PromptQueryTestViewModel getTestModel()
-
refreshSelectionModel
public void refreshSelectionModel(boolean reload)
Refreshes the selection model for the currently selected query.- Parameters:
reload- Whether to reload the query from the database. If false, preserves the existing data from the query and the selection model.
-
selectionModel
public PromptQuerySelectionModel<?,?> selectionModel()
-
updateTestModel
@CanIgnoreReturnValue public PromptQueryTestViewModel updateTestModel()
-
crudCreate
protected PromptQueryViewModel crudCreate(PromptQueryViewModel item) throws FcPromptException
- Specified by:
crudCreatein classItemListModel<PromptQueryViewModel,UUID>- Throws:
FcPromptException
-
crudDelete
protected void crudDelete(PromptQueryViewModel item) throws FcPromptException
- Specified by:
crudDeletein classItemListModel<PromptQueryViewModel,UUID>- Throws:
FcPromptException
-
crudRead
protected PromptQueryViewModel crudRead(UUID uuid) throws FcPromptException
- Specified by:
crudReadin classItemListModel<PromptQueryViewModel,UUID>- Throws:
FcPromptException
-
crudUpdate
protected PromptQueryViewModel crudUpdate(PromptQueryViewModel item) throws FcPromptException
- Specified by:
crudUpdatein classItemListModel<PromptQueryViewModel,UUID>- Throws:
FcPromptException
-
fetchAll
protected List<PromptQueryViewModel> fetchAll() throws FcPromptException
Description copied from class:ItemListModelFetches all available entities. By default, this simple reads all entities matching theQueryCriteriaManagerprovided in the constructor. Override this for custom logic. If you choose to override this, you may providenullfor theQueryCriteriaManager, if you do not call this super method and do not attempt to use it yourself.- Specified by:
fetchAllin classItemListModel<PromptQueryViewModel,UUID>- Returns:
- A list with all available entities. The order of the returned list is preserved.
- Throws:
FcPromptException
-
findName
protected String findName(PromptQueryViewModel item)
- Specified by:
findNamein classItemListModel<PromptQueryViewModel,UUID>
-
getId
protected UUID getId(PromptQueryViewModel item)
- Specified by:
getIdin classItemListModel<PromptQueryViewModel,UUID>
-
getNew
protected PromptQueryViewModel getNew()
- Specified by:
getNewin classItemListModel<PromptQueryViewModel,UUID>
-
getSelectionTypeKey
protected String getSelectionTypeKey()
- Specified by:
getSelectionTypeKeyin classItemListModelSelectByView<PromptQueryViewModel,UUID>
-
isDetached
protected boolean isDetached(PromptQueryViewModel item)
- Specified by:
isDetachedin classItemListModel<PromptQueryViewModel,UUID>
-
isPersisted
protected boolean isPersisted(PromptQueryViewModel item)
- Specified by:
isPersistedin classItemListModel<PromptQueryViewModel,UUID>
-
onSelectionChanged
protected void onSelectionChanged(PromptQueryViewModel newSelected)
Description copied from class:ItemListModelCalled when the selection changes, e.g. when a new item is selected or the selection is cleared.- Overrides:
onSelectionChangedin classItemListModel<PromptQueryViewModel,UUID>- Parameters:
newSelected- The currently selected item, or null if no item is selected.
-
-