Package coop.intergal.ui.views
Interface EntityView<T>
-
- Type Parameters:
T- the entity type
- All Superinterfaces:
HasConfirmation,com.vaadin.flow.component.HasElement,HasNotifications,Serializable
public interface EntityView<T> extends HasConfirmation, HasNotifications
A master / detail view for entities of the typeT. The view has a list of entities (the 'master' part) and a dialog to show a single entity (the 'detail' part). The dialog has two modes: a view mode and an edit mode.The view can also show notifications, error messages, and confirmation requests.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclear()Remove the reference to the entity and reset dirty status.StringgetEntityName()booleanisDirty()Returns the current dirty state of the entity dialog.default voidshowCreatedNotification()default voidshowDeletedNotification()default voidshowError(String message, boolean isPersistent)Shows an error notification with a given text.default voidshowUpdatedNotification()voidwrite(T entity)Writes the changes from the entity dialog into the given entity instance (seeBinder.writeBean(Object))-
Methods inherited from interface coop.intergal.ui.views.HasConfirmation
getConfirmDialog, setConfirmDialog
-
Methods inherited from interface coop.intergal.ui.views.HasNotifications
showNotification, showNotification
-
-
-
-
Method Detail
-
showError
default void showError(String message, boolean isPersistent)
Shows an error notification with a given text.- Parameters:
message- a user-friendly error messageisPersistent- iftruethe message requires a user action to disappear (iffalseit disappears automatically after some time)
-
isDirty
boolean isDirty()
Returns the current dirty state of the entity dialog.- Returns:
trueif the entity dialog is open in the 'edit' mode and has unsaved changes
-
clear
void clear()
Remove the reference to the entity and reset dirty status.
-
write
void write(T entity) throws com.vaadin.flow.data.binder.ValidationException
Writes the changes from the entity dialog into the given entity instance (seeBinder.writeBean(Object))- Parameters:
entity- the entity instance to save the changes into- Throws:
com.vaadin.flow.data.binder.ValidationException- if the values entered into the entity dialog cannot be converted into entity properties
-
getEntityName
String getEntityName()
-
showCreatedNotification
default void showCreatedNotification()
-
showUpdatedNotification
default void showUpdatedNotification()
-
showDeletedNotification
default void showDeletedNotification()
-
-