Class EntityReadAction<E>
- Type Parameters:
E- entity type
- All Implemented Interfaces:
ExecutableAction,TargetAction<EntityPickerComponent<E>>,ViewOpeningAction,Action,HasShortcutCombination
The view is resolved as ReadAction resolves it: the view annotated with
PrimaryReadView, otherwise the view with the <entity>.read id, otherwise
the entity's detail view opened in the read-only mode. In contrast to EntityOpenAction the action
never saves: it requires no UPDATE permission and stays enabled on a read-only view.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.action.SecuredBaseAction
SecuredBaseAction.EnabledRuleNested classes/interfaces inherited from interface io.jmix.flowui.action.ViewOpeningAction
ViewOpeningAction.QueryParametersProvider, ViewOpeningAction.RouteParametersProvider -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DialogWindowsstatic final Stringprotected Messagesprotected Notificationsprotected ActionViewInitializerFields inherited from class io.jmix.flowui.action.valuepicker.PickerAction
targetFields inherited from class io.jmix.flowui.action.SecuredBaseAction
enabledRulesFields inherited from class io.jmix.flowui.action.ObservableBaseAction
uiObservationSupportFields 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_COMBINATION, PROP_TEXT, PROP_VARIANT, PROP_VISIBLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Executes theAction<V extends View<?>>
Consumer<DialogWindow.AfterCloseEvent<V>> @Nullable OpenModeReturns the view open mode if it was set byViewOpeningAction.setOpenMode(OpenMode)or in the view XML, otherwise returnsnull.Returns the view class if it was set byViewOpeningAction.setViewClass(Class)or in the view XML, otherwise returnsnull.@Nullable StringReturns the view id if it was set byViewOpeningAction.setViewId(String)or in the view XML, otherwise returnsnull.protected booleanisEmpty()<V extends View<?>>
voidsetAfterCloseHandler(@Nullable Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) Sets the handler to be invoked when the detail view closes.voidsetDialogWindows(DialogWindows dialogWindows) protected voidvoidsetMessages(Messages messages) voidsetNotifications(Notifications notifications) voidsetOpenMode(@Nullable OpenMode openMode) Sets the view open mode.voidsetQueryParametersProvider(@Nullable ViewOpeningAction.QueryParametersProvider provider) Sets query parameters provider that returns query parameters that should be used in the URL.voidsetRouteParametersProvider(@Nullable ViewOpeningAction.RouteParametersProvider provider) Sets route parameters provider that returns route parameters that should be used in the route template.voidsetTarget(@Nullable EntityPickerComponent<E> target) protected voidsetUiComponentProperties(UiComponentProperties uiComponentProperties) voidsetViewClass(@Nullable Class<? extends View> viewClass) Sets the view class.<V extends View<?>>
voidsetViewConfigurer(@Nullable Consumer<V> viewConfigurer) Sets the view configurer.voidSets the view id.withViewClass(@Nullable Class<? extends View> viewClass) Sets the class of the view to open and returns the action for chaining.<V extends View<?>>
EntityReadAction<E> withViewConfigurer(@Nullable Consumer<V> viewConfigurer) Sets the handler that configures the view before it is shown and returns the action for chaining.withViewId(@Nullable String viewId) Sets the id of the view to open and returns the action for chaining.Methods inherited from class io.jmix.flowui.action.valuepicker.PickerAction
actionPerform, checkTarget, getTarget, initAction, isApplicable, withTargetMethods inherited from class io.jmix.flowui.action.SecuredBaseAction
addEnabledRule, isEnabledByRule, isPermitted, refreshState, removeEnabledRuleMethods inherited from class io.jmix.flowui.action.ObservableBaseAction
getUiObservationSupportMethods inherited from class io.jmix.flowui.kit.action.BaseAction
addActionPerformedListener, self, setEnabled, setEnabledInternal, setVisible, setVisibleInternal, withDescription, withEnabled, withHandler, withIcon, withShortcutCombination, withText, withVariant, withVisibleMethods inherited from class io.jmix.flowui.kit.action.AbstractAction
addPropertyChangeListener, firePropertyChange, getDescription, getEventBus, getIcon, getIconComponent, getId, getShortcutCombination, getText, getVariant, hasListener, isEnabled, isVisible, setDescription, setIcon, setIconComponent, 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, getIconComponent, getId, getText, getVariant, isEnabled, isVisible, refreshState, setDescription, setEnabled, setIcon, setIconComponent, setText, setVariant, setVisibleMethods inherited from interface io.jmix.flowui.kit.component.HasShortcutCombination
getShortcutCombination, setShortcutCombination
-
Field Details
-
ID
- See Also:
-
messages
-
notifications
-
dialogWindows
-
viewInitializer
-
-
Constructor Details
-
EntityReadAction
public EntityReadAction() -
EntityReadAction
-
-
Method Details
-
setDialogWindows
-
setNotifications
-
setMessages
-
setUiComponentProperties
-
setIcons
-
setTarget
- Specified by:
setTargetin interfaceTargetAction<E>- Overrides:
setTargetin classPickerAction<EntityReadAction<E>,EntityPickerComponent<E>, E>
-
getOpenMode
Description copied from interface:ViewOpeningActionReturns the view open mode if it was set byViewOpeningAction.setOpenMode(OpenMode)or in the view XML, otherwise returnsnull.- Specified by:
getOpenModein interfaceViewOpeningAction
-
setOpenMode
Description copied from interface:ViewOpeningActionSets the view open mode.- Specified by:
setOpenModein interfaceViewOpeningAction- Parameters:
openMode- the open mode to set
-
getViewId
Description copied from interface:ViewOpeningActionReturns the view id if it was set byViewOpeningAction.setViewId(String)or in the view XML, otherwise returnsnull.- Specified by:
getViewIdin interfaceViewOpeningAction
-
setViewId
Description copied from interface:ViewOpeningActionSets the view id.- Specified by:
setViewIdin interfaceViewOpeningAction- Parameters:
viewId- the view id to set
-
getViewClass
Description copied from interface:ViewOpeningActionReturns the view class if it was set byViewOpeningAction.setViewClass(Class)or in the view XML, otherwise returnsnull.- Specified by:
getViewClassin interfaceViewOpeningAction
-
setViewClass
Description copied from interface:ViewOpeningActionSets the view class.- Specified by:
setViewClassin interfaceViewOpeningAction- Parameters:
viewClass- the view class to set
-
getRouteParametersProvider
- Specified by:
getRouteParametersProviderin interfaceViewOpeningAction- Returns:
- route parameters or
nullif not set
-
setRouteParametersProvider
public void setRouteParametersProvider(@Nullable ViewOpeningAction.RouteParametersProvider provider) Description copied from interface:ViewOpeningActionSets route parameters provider that returns route parameters that should be used in the route template.Note that route parameters provider is set if the detail is opened in
OpenMode.NAVIGATION.- Specified by:
setRouteParametersProviderin interfaceViewOpeningAction- Parameters:
provider- route parameters provider to set- See Also:
-
getQueryParametersProvider
- Specified by:
getQueryParametersProviderin interfaceViewOpeningAction- Returns:
- query parameters provider or
nullif not set
-
setQueryParametersProvider
public void setQueryParametersProvider(@Nullable ViewOpeningAction.QueryParametersProvider provider) Description copied from interface:ViewOpeningActionSets query parameters provider that returns query parameters that should be used in the URL.Note that query parameters provider is set if the detail is opened in
OpenMode.NAVIGATION.- Specified by:
setQueryParametersProviderin interfaceViewOpeningAction- Parameters:
provider- query parameters provider to set
-
setAfterCloseHandler
public <V extends View<?>> void setAfterCloseHandler(@Nullable Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) Description copied from interface:ViewOpeningActionSets the handler to be invoked when the detail view closes.Note that handler is invoked if the detail 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.SAVE)) { System.out.println("Saved"); } }- Specified by:
setAfterCloseHandlerin interfaceViewOpeningAction- Type Parameters:
V- view type- Parameters:
afterCloseHandler- handler to set
-
getAfterCloseHandler
- Specified by:
getAfterCloseHandlerin interfaceViewOpeningAction
-
setViewConfigurer
Description copied from interface:ViewOpeningActionSets the view configurer. Use the configurer if you need to provide parameters to the opened view through setters.The preferred way to set the configurer is using a controller method annotated with
Install, e.g.:@Install(to = "petsTable.view", subject = "viewConfigurer") protected void petsTableViewConfigurer(View<?> view) { view.setSomeParameter(someValue); }- Specified by:
setViewConfigurerin interfaceViewOpeningAction
-
getViewConfigurer
- Specified by:
getViewConfigurerin interfaceViewOpeningAction
-
execute
public void execute()Description copied from interface:ExecutableActionExecutes theAction- Specified by:
executein interfaceExecutableAction
-
withViewId
Sets the id of the view to open and returns the action for chaining.- Parameters:
viewId- id of the view to open- Returns:
- this instance for chaining
-
withViewClass
Sets the class of the view to open and returns the action for chaining.- Parameters:
viewClass- class of the view to open- Returns:
- this instance for chaining
-
withViewConfigurer
public <V extends View<?>> EntityReadAction<E> withViewConfigurer(@Nullable Consumer<V> viewConfigurer) Sets the handler that configures the view before it is shown and returns the action for chaining.- Type Parameters:
V- view type- Parameters:
viewConfigurer- handler to set- Returns:
- this instance for chaining
-
isEmpty
protected boolean isEmpty()
-