public abstract class EntityForm<T,ID extends Serializable>
extends com.vaadin.flow.component.orderedlayout.VerticalLayout
| Modifier and Type | Class and Description |
|---|---|
static interface |
EntityForm.LeaveListener |
static interface |
EntityForm.SaveListener |
static interface |
EntityForm.StayListener |
| Modifier and Type | Field and Description |
|---|---|
protected com.vaadin.flow.data.binder.Binder<T> |
binder |
protected com.vaadin.flow.component.orderedlayout.HorizontalLayout |
buttons |
protected com.vaadin.flow.component.button.Button |
cancel |
protected String |
cancelText |
protected Boolean |
confirm |
protected Boolean |
create |
protected String |
createText |
protected Boolean |
disableSaveUntilChange |
protected String |
editText |
protected T |
entity |
protected Class<T> |
entityClass |
protected ID |
entityId |
protected String |
entityTypeName |
protected NestedOrderedLayout<?> |
formLayout |
protected Set<EntityForm.LeaveListener> |
leaveListeners |
protected Boolean |
loadFromId |
static org.slf4j.Logger |
LOGGER |
protected Boolean |
persist |
protected com.vaadin.flow.component.button.Button |
save |
protected Boolean |
saved |
protected Set<EntityForm.SaveListener> |
saveListeners |
protected String |
saveText |
protected com.vaadin.flow.component.html.Span |
title |
protected com.vaadin.flow.component.orderedlayout.HorizontalLayout |
titleLayout |
| Constructor and Description |
|---|
EntityForm(Class<T> eClass,
ID id,
Boolean loadFromId) |
EntityForm(Class<T> eClass,
T entity) |
EntityForm(Class<T> eClass,
T entity,
Boolean load) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLeaveListener(EntityForm.LeaveListener sl) |
void |
addSaveListener(EntityForm.SaveListener sl) |
protected void |
bind() |
void |
confirmLeave() |
void |
confirmLeave(EntityForm.LeaveListener leaveOverride,
EntityForm.StayListener stay)
This method checks for any form changes before proceeding with leaving the form
The override listener allows you to override the standard leavelisteners
|
protected T |
createEntity() |
com.vaadin.flow.component.orderedlayout.HorizontalLayout |
getButtons() |
T |
getEntity() |
protected abstract ID |
getEntityId(T e) |
String |
getEntityTypeName() |
NestedOrderedLayout<?> |
getFormLayout() |
Boolean |
getPersist() |
protected abstract org.springframework.data.jpa.repository.JpaRepository<T,ID> |
getRepository() |
Boolean |
getSaved() |
com.vaadin.flow.component.html.Span |
getTitle() |
Boolean |
isCreate() |
protected void |
leave() |
protected T |
loadEntity() |
protected void |
persist() |
void |
postConstruct() |
protected void |
save() |
protected void |
saveAndLeave() |
void |
setEntity(T e) |
void |
setPersist(Boolean persist) |
protected abstract void |
setupForm() |
addAndExpand, getAlignItems, getAlignSelf, getDefaultHorizontalComponentAlignment, getHorizontalComponentAlignment, setAlignItems, setAlignSelf, setDefaultHorizontalComponentAlignment, setHorizontalComponentAlignment, setPadding, setSpacingaddListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBoxSizing, getThemeList, isMargin, isPadding, isSpacing, setBoxSizing, setMarginexpand, getFlexGrow, getJustifyContentMode, replace, setFlexGrow, setJustifyContentModegetChildren, getComponentAt, getComponentCount, indexOfadd, add, addComponentAsFirst, addComponentAtIndex, remove, removeAlladdClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNamegetCssSize, getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullpublic static final org.slf4j.Logger LOGGER
protected ID extends Serializable entityId
protected T entity
protected com.vaadin.flow.data.binder.Binder<T> binder
protected Boolean create
protected NestedOrderedLayout<?> formLayout
protected String entityTypeName
protected Boolean saved
protected String createText
protected String editText
protected String cancelText
protected com.vaadin.flow.component.button.Button cancel
protected com.vaadin.flow.component.button.Button save
protected String saveText
protected Set<EntityForm.LeaveListener> leaveListeners
protected Boolean persist
protected com.vaadin.flow.component.orderedlayout.HorizontalLayout buttons
protected com.vaadin.flow.component.html.Span title
protected Boolean loadFromId
protected Boolean confirm
protected com.vaadin.flow.component.orderedlayout.HorizontalLayout titleLayout
protected Boolean disableSaveUntilChange
protected Set<EntityForm.SaveListener> saveListeners
@PostConstruct public void postConstruct()
protected abstract org.springframework.data.jpa.repository.JpaRepository<T,ID> getRepository()
protected abstract void setupForm()
protected void saveAndLeave()
public void confirmLeave(EntityForm.LeaveListener leaveOverride, EntityForm.StayListener stay)
public void confirmLeave()
protected void leave()
protected T loadEntity()
protected T createEntity()
public void setEntity(T e)
protected void save()
throws com.vaadin.flow.data.binder.ValidationException
com.vaadin.flow.data.binder.ValidationExceptionprotected void bind()
throws com.vaadin.flow.data.binder.ValidationException
com.vaadin.flow.data.binder.ValidationExceptionprotected void persist()
public Boolean getSaved()
public T getEntity()
public Boolean getPersist()
public void setPersist(Boolean persist)
public Boolean isCreate()
public String getEntityTypeName()
public void addSaveListener(EntityForm.SaveListener sl)
public void addLeaveListener(EntityForm.LeaveListener sl)
public NestedOrderedLayout<?> getFormLayout()
public com.vaadin.flow.component.orderedlayout.HorizontalLayout getButtons()
public com.vaadin.flow.component.html.Span getTitle()
Copyright © 2021. All rights reserved.