T
- The type of the encapsulated entity.public interface IEntityListModel<T extends ITransferableEntity> extends IUpdatable
Modifier and Type | Method and Description |
---|---|
void |
addMarked(T entity)
Adds the given entity to the
List of marked entities |
void |
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 as
delete(String) , but takes the model to be deleted as an argument instead of deleting the currently
selected model. |
String |
deleteEntity(T model)
Same as
delete() , but takes the model to be deleted as an argument instead of deleting the currently
selected model. |
void |
deleteMarkedEntities()
Deletes all marked entities
|
List<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 the
List of marked entities |
void |
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 entities
|
void |
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 entities
|
void |
updateSelected()
Rereads the currently model from the database, discarding any local, unsaved changes.
|
updateData
void addNew()
boolean isMarkedDeletable()
true
iff every single marked entity is deletable. false
otherwisevoid deleteMarkedEntities()
String deleteEntity(T model)
delete()
, but takes the model to be deleted as an argument instead of deleting the currently
selected model.model
- The model to be deleted.String deleteEntity(String targetView, T model)
delete(String)
, but takes the model to be deleted as an argument instead of deleting the currently
selected model.targetView
- The Enum.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.String delete()
isNew()
, does
nothing.String delete(String targetView)
isNew()
, does
nothing.targetView
- The Enum.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.List<T> getAllPlusNew()
isNew()
, unsaved model, if it exists.List<T> getFiltered()
getAll()
, with some models excluded according to some filter criterion.List<T> getMarked()
List
of entities that have been marked (i.e. for further processing)void addMarked(T entity)
List
of marked entitiesentity
- to be addedvoid removeMarked(T entity)
List
of marked entitiesentity
- to be removedT getSelected()
boolean hasEntity()
true
iff not #isEmptyList()
or the currently selected model isNew()
.boolean isEmptyList()
true
iff getAll()
is empty.boolean isNew()
void loadLazyData()
void save()
isNew()
, creates a new entry in the database,
otherwise updates the existing entry.void setFiltered(List<T> filtered)
getAll()
.filtered
- List of filtered models to set.void setMarked(List<T> marked)
marked
- List
of entities to be markedvoid setSelected(T selected)
getSelected()
model
may not refer to the same instance as the given model.selected
- The model to be selected.void setSelectedFromMarked()
void updateSelected()
isNew()
.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)
Copyright © 2021 XIMA MEDIA GmbH. All rights reserved.