Class BasicEntityViewSettings
java.lang.Object
com.foreach.across.modules.entity.views.settings.BasicEntityViewSettings
- All Implemented Interfaces:
Consumer<EntityViewFactoryBuilder>
Basic consumer that allows addition of view processors, setting the admin menu attribute
and adding a custom access validation predicate.
It supports configuration of the following processors:
- Since:
- 3.0.0
- Author:
- Arne Vandamme
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(EntityViewFactoryBuilder builder) Apply the configuration to the view factory builder.accessValidator
(@NonNull BiPredicate<EntityViewFactory, EntityViewContext> accessValidator) Attach a custom access validator that should be used for this view.Register a default view menu item with the registered path.adminMenu
(@NonNull String menuPath, Consumer<com.foreach.across.modules.web.menu.PathBasedMenuBuilder.PathBasedMenuItemBuilder> itemCustomizer) Register a default view menu item with the registered path.adminMenu
(@NonNull Consumer<EntityAdminMenuEvent<S>> menuEventConsumer) Register a custom menu event consumer.renderAdminMenu
(Boolean renderAdminMenu) Should this view render the admin menu.titleMessageCode
(String titleMessageCode) Set the message code that should be used as title for the view.
-
Constructor Details
-
BasicEntityViewSettings
public BasicEntityViewSettings()
-
-
Method Details
-
adminMenu
Register a default view menu item with the registered path.- Parameters:
menuPath
- for the item- Returns:
- current consumer
-
adminMenu
public BasicEntityViewSettings adminMenu(@NonNull @NonNull String menuPath, Consumer<com.foreach.across.modules.web.menu.PathBasedMenuBuilder.PathBasedMenuItemBuilder> itemCustomizer) Register a default view menu item with the registered path.- Parameters:
menuPath
- for the itemitemCustomizer
- for additional customization of the menu item- Returns:
- current consumer
-
adminMenu
public <S> BasicEntityViewSettings adminMenu(@NonNull @NonNull Consumer<EntityAdminMenuEvent<S>> menuEventConsumer) Register a custom menu event consumer.- Type Parameters:
S
- entity type- Parameters:
menuEventConsumer
- for handling the menu- Returns:
- current consumer
-
accept
Apply the configuration to the view factory builder.- Specified by:
accept
in interfaceConsumer<EntityViewFactoryBuilder>
- Parameters:
builder
- for the view factory
-
renderAdminMenu
Should this view render the admin menu.- Returns:
this
.
-
titleMessageCode
Set the message code that should be used as title for the view.- Returns:
this
.
-
accessValidator
public BasicEntityViewSettings accessValidator(@NonNull @NonNull BiPredicate<EntityViewFactory, EntityViewContext> accessValidator) Attach a custom access validator that should be used for this view. Note that if you want to keep the default access validation as well, you should combine withEntityViewFactoryAttributes.defaultAccessValidator()
.- Returns:
this
.
-