Class BuildEntityDeleteViewEvent<T>
java.lang.Object
com.foreach.across.modules.entity.views.events.BuildEntityDeleteViewEvent<T>
- All Implemented Interfaces:
org.springframework.core.ResolvableTypeProvider
public final class BuildEntityDeleteViewEvent<T>
extends Object
implements org.springframework.core.ResolvableTypeProvider
Event published by the
DeleteEntityViewProcessor
before building
the actual view. Allows basic configuration of the delete form: customizing feedback messages, showing related
entities and suppressing the actual ability to delete the entity. The delete view can be seen as the confirmation
page (are you sure you want to?) before the actual delete.
For example: In case of related entities that will not automatically be deleted beforehand,
setDeleteDisabled(boolean)
can be used to disallow the delete action until those related entities have
been deleted manually.- Since:
- 2.0.0
- Author:
- Arne Vandamme
-
Constructor Summary
ConstructorDescriptionBuildEntityDeleteViewEvent
(T entity, com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext) -
Method Summary
Modifier and TypeMethodDescriptioncom.foreach.across.modules.web.ui.elements.ContainerViewElement
com.foreach.across.modules.web.ui.ViewElementBuilderContext
org.springframework.core.ResolvableType
boolean
com.foreach.across.modules.web.ui.elements.ContainerViewElement
messages()
void
setAssociations
(com.foreach.across.modules.web.ui.elements.ContainerViewElement associations) void
setDeleteDisabled
(boolean deleteDisabled) Should the delete action be disallowed.void
setMessages
(com.foreach.across.modules.web.ui.elements.ContainerViewElement messages) Set the container containing message elements.
-
Constructor Details
-
BuildEntityDeleteViewEvent
public BuildEntityDeleteViewEvent(T entity, com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext)
-
-
Method Details
-
messages
public com.foreach.across.modules.web.ui.elements.ContainerViewElement messages()- Returns:
- container with feedback messages
-
setMessages
public void setMessages(com.foreach.across.modules.web.ui.elements.ContainerViewElement messages) Set the container containing message elements. -
associations
public com.foreach.across.modules.web.ui.elements.ContainerViewElement associations()- Returns:
- list with the association feedback items
-
setAssociations
public void setAssociations(com.foreach.across.modules.web.ui.elements.ContainerViewElement associations) -
getResolvableType
public org.springframework.core.ResolvableType getResolvableType()- Specified by:
getResolvableType
in interfaceorg.springframework.core.ResolvableTypeProvider
-
getEntity
- Returns:
- the actual entity for which the delete view is being rendered
-
getBuilderContext
public com.foreach.across.modules.web.ui.ViewElementBuilderContext getBuilderContext()- Returns:
- the current builder context
-
isDeleteDisabled
public boolean isDeleteDisabled()- Returns:
true
if the actual delete action is not allowed
-
setDeleteDisabled
public void setDeleteDisabled(boolean deleteDisabled) Should the delete action be disallowed. If set totrue
the delete view will not render the actual delete button.- Parameters:
deleteDisabled
-true
if deleting should not be allowed
-