Class EntityLookupAction<E>
java.lang.Object
io.jmix.flowui.kit.action.AbstractAction
io.jmix.flowui.kit.action.BaseAction
io.jmix.flowui.action.SecuredBaseAction
io.jmix.flowui.action.valuepicker.PickerAction<EntityLookupAction<E>,EntityPickerComponent<E>,E>
io.jmix.flowui.action.entitypicker.EntityLookupAction<E>
- All Implemented Interfaces:
ExecutableAction,ScreenOpeningAction,SecuredAction,TargetAction<EntityPickerComponent<E>>,Action
@ActionType("entity_lookup")
public class EntityLookupAction<E>
extends PickerAction<EntityLookupAction<E>,EntityPickerComponent<E>,E>
implements ScreenOpeningAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DialogWindowBuildersstatic final Stringprotected ActionScreenInitializerprotected Predicate<LookupScreen.ValidationContext<E>>protected Function<Collection<E>,Collection<E>> Fields inherited from class io.jmix.flowui.action.valuepicker.PickerAction
targetFields inherited from class io.jmix.flowui.action.SecuredBaseAction
enabledByUiPermissions, visibleByUiPermissionsFields inherited from class io.jmix.flowui.kit.action.BaseAction
enabledExplicitly, visibleExplicitlyFields inherited from class io.jmix.flowui.kit.action.AbstractAction
description, enabled, eventBus, icon, id, shortcutCombination, text, variant, visibleFields inherited from interface io.jmix.flowui.kit.action.Action
PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_TEXT, PROP_VARIANT, PROP_VISIBLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Executes theActionReturns the screen open mode if it was set byScreenOpeningAction.setOpenMode(OpenMode)or in the screen XML, otherwise returnsnull.com.vaadin.flow.router.QueryParameterscom.vaadin.flow.router.RouteParametersReturns the screen class if it was set byScreenOpeningAction.setScreenClass(Class)or in the screen XML, otherwise returnsnull.Returns the screen id if it was set byScreenOpeningAction.setScreenId(String)or in the screen XML, otherwise returnsnull.protected void<S extends Screen<?>>
voidsetAfterCloseHandler(Consumer<DialogWindow.AfterCloseEvent<S>> afterCloseHandler) Sets the handler to be invoked when the editor screen closes.voidsetDialogBuilders(DialogWindowBuilders dialogBuilders) protected voidsetFlowUiComponentProperties(FlowUiComponentProperties flowUiComponentProperties) voidsetMessages(Messages messages) voidsetOpenMode(OpenMode openMode) Sets the screen open mode.voidsetQueryParameters(com.vaadin.flow.router.QueryParameters queryParameters) Sets query parameters that should be used in the URL.voidsetRouteParameters(com.vaadin.flow.router.RouteParameters routeParameters) Sets route parameters that should be used in the route template.voidsetScreenClass(Class<? extends Screen> screenClass) Sets the screen class.voidsetScreenId(String screenId) Sets the screen id.voidsetSelectValidator(Predicate<LookupScreen.ValidationContext<E>> selectValidator) voidsetTransformation(Function<Collection<E>, Collection<E>> transformation) withSelectValidator(Predicate<LookupScreen.ValidationContext<E>> selectValidator) withTransformation(Function<Collection<E>, Collection<E>> transformation) Methods inherited from class io.jmix.flowui.action.valuepicker.PickerAction
actionPerform, checkTarget, getTarget, isApplicable, setTarget, withEnabled, withEnabledByUiPermissions, withHandler, withIcon, withIcon, withShortcutCombination, withTarget, withText, withTitle, withVariant, withVisible, withVisibleByUiPermissionsMethods inherited from class io.jmix.flowui.action.SecuredBaseAction
isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, setEnabledByUiPermissions, setVisibleByUiPermissionsMethods inherited from class io.jmix.flowui.kit.action.BaseAction
addActionPerformedListener, setEnabled, setEnabledInternal, setVisible, setVisibleInternalMethods inherited from class io.jmix.flowui.kit.action.AbstractAction
addPropertyChangeListener, firePropertyChange, getDescription, getEventBus, getIcon, getId, getShortcutCombination, getText, getVariant, hasListener, isEnabled, isVisible, setDescription, setIcon, setShortcutCombination, setText, setVariantMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.flowui.kit.action.Action
actionPerform, addPropertyChangeListener, getDescription, getIcon, getId, getShortcutCombination, getText, getVariant, isEnabled, isVisible, refreshState, setDescription, setEnabled, setIcon, setShortcutCombination, setText, setVariant, setVisible
-
Field Details
-
ID
- See Also:
-
dialogBuilders
-
screenInitializer
-
selectValidator
-
transformation
-
-
Constructor Details
-
EntityLookupAction
public EntityLookupAction() -
EntityLookupAction
-
-
Method Details
-
initAction
protected void initAction()- Overrides:
initActionin classPickerAction<EntityLookupAction<E>,EntityPickerComponent<E>, E>
-
setDialogBuilders
-
setMessages
-
setFlowUiComponentProperties
@Autowired protected void setFlowUiComponentProperties(FlowUiComponentProperties flowUiComponentProperties) -
setSelectValidator
-
setTransformation
-
getOpenMode
Description copied from interface:ScreenOpeningActionReturns the screen open mode if it was set byScreenOpeningAction.setOpenMode(OpenMode)or in the screen XML, otherwise returnsnull.- Specified by:
getOpenModein interfaceScreenOpeningAction
-
setOpenMode
Description copied from interface:ScreenOpeningActionSets the screen open mode.- Specified by:
setOpenModein interfaceScreenOpeningAction- Parameters:
openMode- the open mode to set
-
getScreenId
Description copied from interface:ScreenOpeningActionReturns the screen id if it was set byScreenOpeningAction.setScreenId(String)or in the screen XML, otherwise returnsnull.- Specified by:
getScreenIdin interfaceScreenOpeningAction
-
setScreenId
Description copied from interface:ScreenOpeningActionSets the screen id.- Specified by:
setScreenIdin interfaceScreenOpeningAction- Parameters:
screenId- the screen id to set
-
getScreenClass
Description copied from interface:ScreenOpeningActionReturns the screen class if it was set byScreenOpeningAction.setScreenClass(Class)or in the screen XML, otherwise returnsnull.- Specified by:
getScreenClassin interfaceScreenOpeningAction
-
setScreenClass
Description copied from interface:ScreenOpeningActionSets the screen class.- Specified by:
setScreenClassin interfaceScreenOpeningAction- Parameters:
screenClass- the screen class to set
-
getRouteParameters
@Nullable public com.vaadin.flow.router.RouteParameters getRouteParameters()- Specified by:
getRouteParametersin interfaceScreenOpeningAction- Returns:
- route parameters or
nullif not set
-
setRouteParameters
public void setRouteParameters(@Nullable com.vaadin.flow.router.RouteParameters routeParameters) Description copied from interface:ScreenOpeningActionSets route parameters that should be used in the route template.Note that route parameters are set if the editor is opened in
OpenMode.NAVIGATION.- Specified by:
setRouteParametersin interfaceScreenOpeningAction- Parameters:
routeParameters- route parameters to set- See Also:
-
Route
-
getQueryParameters
@Nullable public com.vaadin.flow.router.QueryParameters getQueryParameters()- Specified by:
getQueryParametersin interfaceScreenOpeningAction- Returns:
- query parameters or
nullif not set
-
setQueryParameters
public void setQueryParameters(@Nullable com.vaadin.flow.router.QueryParameters queryParameters) Description copied from interface:ScreenOpeningActionSets query parameters that should be used in the URL.Note that query parameters are set if the editor is opened in
OpenMode.NAVIGATION.- Specified by:
setQueryParametersin interfaceScreenOpeningAction- Parameters:
queryParameters- query parameters to set
-
setAfterCloseHandler
public <S extends Screen<?>> void setAfterCloseHandler(@Nullable Consumer<DialogWindow.AfterCloseEvent<S>> afterCloseHandler) Description copied from interface:ScreenOpeningActionSets the handler to be invoked when the editor screen closes.Note that handler is invoked if the editor is opened in
OpenMode.DIALOGmode.The preferred way to set the handler is using a controller method annotated with
Install, e.g.:@Install(to = "petsTable.view", subject = "afterCloseHandler") protected void petsTableViewAfterCloseHandler(AfterCloseEvent event) { if (event.closedWith(StandardOutcome.COMMIT)) { System.out.println("Committed"); } }- Specified by:
setAfterCloseHandlerin interfaceScreenOpeningAction- Type Parameters:
S- screen type- Parameters:
afterCloseHandler- handler to set
-
execute
public void execute()Description copied from interface:ExecutableActionExecutes theAction- Specified by:
executein interfaceExecutableAction
-
withSelectValidator
public EntityLookupAction<E> withSelectValidator(Predicate<LookupScreen.ValidationContext<E>> selectValidator) -
withTransformation
public EntityLookupAction<E> withTransformation(Function<Collection<E>, Collection<E>> transformation)
-