Package de.xima.fc.gui.interfaces.data
Interface IEntityListModel<T extends ITransferableEntity>
-
- Type Parameters:
T
- The type of the encapsulated entity.
- All Superinterfaces:
IUpdatable
,Serializable
- All Known Subinterfaces:
IEntityListModelSelectByView<T>
- All Known Implementing Classes:
AppointmentTemplateListModel
,ClientBean.EntityListModelImpl
,ClientCounterConfigBean.EntityListModelImpl
,ClientResourceBean.EntityListModelImpl
,DataSourcesBean.EntityListModelImpl
,DbConnectionBean.EntityListModelImpl
,DbQueryBean.EntityListModelImpl
,EntityListModel
,EntityListModelSelectByView
,ExternalUserClientBean.EntityListModelImpl
,ExternalUserSystemBean.EntityListModelImpl
,FrontendServerBean.EntityListModelImpl
,InboxBean.EntityListModelImpl
,LdapConnectionBean.EntityListModelImpl
,LDAPGroupBean.EntityListModelImpl
,LdapQueryBean.EntityListModelImpl
,LicenseBean.EntityListModelImpl
,MandantFrontendServerBean.EntityListModelImpl
,ProjectBean.EntityListModelImpl
,ProjectResourceBean.EntityListModelImpl
,SystemMessagesBean.EntityListModelImpl
,TemplatesBean.EntityListModelImpl
,UserBean.EntityListModelImpl
,UserGroupBean.EntityListModelImpl
,UserRoleBean.EntityListModelImpl
public interface IEntityListModel<T extends ITransferableEntity> extends IUpdatable
Describes a list of entities of which one can be selected. Mostly used for views with a list of editable entities, such as a list of files for a project.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addMarked(T entity)
Adds the given entity to theList
of marked entitiesvoid
addNew()
Sets the currently selected model to a new model.String
delete()
Deletes the currently selected model from the database.String
delete(String targetView)
Deletes the currently selected model from the database.String
deleteEntity(String targetView, T model)
Same asdelete(String)
, but takes the model to be deleted as an argument instead of deleting the currently selected model.String
deleteEntity(T model)
Same asdelete()
, but takes the model to be deleted as an argument instead of deleting the currently selected model.void
deleteMarkedEntities()
Deletes all marked entitiesList<T>
getAll()
List<T>
getAllPlusNew()
List<T>
getFiltered()
List<T>
getMarked()
T
getSelected()
boolean
hasEntity()
boolean
isEmptyList()
boolean
isMarkedDeletable()
boolean
isNew()
void
loadLazyData()
Can be overriden to initialize lazily loaded fields on the entity.void
onRowSelect(org.primefaces.event.SelectEvent event)
void
onRowSelectCheckbox(org.primefaces.event.SelectEvent event)
void
onRowUnselectCheckbox(org.primefaces.event.UnselectEvent event)
void
onToggleSelect(org.primefaces.event.ToggleSelectEvent event)
void
removeMarked(T entity)
Removes the given entity from theList
of marked entitiesvoid
save()
Saves the currently selected model to the database.void
setFiltered(List<T> filtered)
Sets the list of filtered models.void
setMarked(List<T> marked)
Sets the list of marked entitiesvoid
setSelected(T selected)
Sets the currently selected model to the given model.void
setSelectedFromMarked()
Sets the currently selected from the the List of currently marked entitiesvoid
updateSelected()
Rereads the currently model from the database, discarding any local, unsaved changes.-
Methods inherited from interface de.xima.fc.gui.interfaces.data.IUpdatable
updateData
-
-
-
-
Method Detail
-
addNew
void addNew()
Sets the currently selected model to a new model. A new model is not yet persisted in the database and exists only in memory.
-
isMarkedDeletable
boolean isMarkedDeletable()
- Returns:
true
iff every single marked entity is deletable.false
otherwise
-
deleteMarkedEntities
void deleteMarkedEntities()
Deletes all marked entities
-
deleteEntity
String deleteEntity(T model)
Same asdelete()
, but takes the model to be deleted as an argument instead of deleting the currently selected model.- Parameters:
model
- The model to be deleted.- Returns:
- A view ID of the page to show after the model was deleted.
-
deleteEntity
String deleteEntity(String targetView, T model)
Same asdelete(String)
, but takes the model to be deleted as an argument instead of deleting the currently selected model.- Parameters:
targetView
- TheEnum.name()
of a view whose view ID is returned after this operation completes successfully. Can also be a relative path, in which case that path is returned.model
- The model to be deleted.- Returns:
- A view ID of the page to show after the model was deleted.
-
delete
String delete()
Deletes the currently selected model from the database. If the currently selected modelisNew()
, does nothing.- Returns:
- A view ID of the page to show after the model was deleted.
-
delete
String delete(String targetView)
Deletes the currently selected model from the database. If the currently selected modelisNew()
, does nothing.- Parameters:
targetView
- TheEnum.name()
of a view whose view ID is returned after this operation completes successfully. Can also be a relative path, in which case that path is returned.- Returns:
- A view ID of the page to show after the model was deleted.
-
getAllPlusNew
List<T> getAllPlusNew()
- Returns:
- A list of all models, including the #
isNew()
, unsaved model, if it exists.
-
getFiltered
List<T> getFiltered()
- Returns:
- A subset of
getAll()
, with some models excluded according to some filter criterion.
-
getMarked
List<T> getMarked()
- Returns:
List
of entities that have been marked (i.e. for further processing)
-
addMarked
void addMarked(T entity)
Adds the given entity to theList
of marked entities- Parameters:
entity
- to be added
-
removeMarked
void removeMarked(T entity)
Removes the given entity from theList
of marked entities- Parameters:
entity
- to be removed
-
getSelected
T getSelected()
- Returns:
- The currently selected model. A new model if none is selected.
-
hasEntity
boolean hasEntity()
- Returns:
true
iff not #isEmptyList()
or the currently selected modelisNew()
.
-
isEmptyList
boolean isEmptyList()
- Returns:
true
iffgetAll()
is empty.
-
isNew
boolean isNew()
- Returns:
- Whether the currently selected model is new, ie. whether it is persisted in the database or exists only in memory.
-
loadLazyData
void loadLazyData()
Can be overriden to initialize lazily loaded fields on the entity. By default, does not load any lazy data.
-
save
void save()
Saves the currently selected model to the database. If itisNew()
, creates a new entry in the database, otherwise updates the existing entry.
-
setFiltered
void setFiltered(List<T> filtered)
Sets the list of filtered models. This should be subset ofgetAll()
.- Parameters:
filtered
- List of filtered models to set.
-
setMarked
void setMarked(List<T> marked)
Sets the list of marked entities- Parameters:
marked
-List
of entities to be marked
-
setSelected
void setSelected(T selected)
Sets the currently selected model to the given model. If the given model exists in the database but is not currently managed by an entity manager, rereads the model from the database. Thus thegetSelected()
model may not refer to the same instance as the given model.- Parameters:
selected
- The model to be selected.
-
setSelectedFromMarked
void setSelectedFromMarked()
Sets the currently selected from the the List of currently marked entities
-
updateSelected
void updateSelected()
Rereads the currently model from the database, discarding any local, unsaved changes. Does nothing iff the currently selected modelisNew()
.
-
onRowSelect
void onRowSelect(org.primefaces.event.SelectEvent event)
-
onRowSelectCheckbox
void onRowSelectCheckbox(org.primefaces.event.SelectEvent event)
-
onRowUnselectCheckbox
void onRowUnselectCheckbox(org.primefaces.event.UnselectEvent event)
-
onToggleSelect
void onToggleSelect(org.primefaces.event.ToggleSelectEvent event)
-
-