Class ReadAction<E>
- All Implemented Interfaces:
- ExecutableAction,- SecuredAction,- SecurityConstraintAction,- TargetAction<ListDataComponent<E>>,- ViewOpeningAction,- Action,- HasShortcutCombination
- 
Nested Class SummaryNested classes/interfaces inherited from class io.jmix.flowui.action.SecuredBaseActionSecuredBaseAction.EnabledRuleNested classes/interfaces inherited from interface io.jmix.flowui.action.ViewOpeningActionViewOpeningAction.QueryParametersProvider, ViewOpeningAction.RouteParametersProvider
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected DialogWindowsstatic final Stringprotected OpenModeprotected ReadOnlyViewsSupportprotected booleanprotected ActionViewInitializerprotected ViewNavigatorsFields inherited from class io.jmix.flowui.action.list.SecuredListDataComponentActionaccessManager, applicationContext, constraintEntityOp, metadataFields inherited from class io.jmix.flowui.action.list.ListDataComponentActionselectionListenerRegistration, targetFields inherited from class io.jmix.flowui.action.SecuredBaseActionenabledByUiPermissions, enabledRules, visibleByUiPermissionsFields inherited from class io.jmix.flowui.kit.action.BaseActionenabledExplicitly, visibleExplicitlyFields inherited from class io.jmix.flowui.kit.action.AbstractActiondescription, enabled, eventBus, icon, id, shortcutCombination, text, variant, visibleFields inherited from interface io.jmix.flowui.kit.action.ActionPROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT_COMBINATION, PROP_TEXT, PROP_VARIANT, PROP_VISIBLE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidexecute()Executes the action.<V extends View<?>>
 Consumer<DialogWindow.AfterCloseEvent<V>>Returns the view open mode if it was set byViewOpeningAction.setOpenMode(OpenMode)or in the view XML, otherwise returnsnull.Returns the detail view class if it was set bysetViewClass(Class)or in the view XML.Returns the detail view id if it was set bysetViewId(String)or in the view XML.protected voidprotected booleanprotected booleanprotected voidprotected voidopenDialog(E editedEntity) <V extends View<?>>
 voidsetAfterCloseHandler(Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) Sets the handler to be invoked when the detail view closes.voidsetAfterSaveHandler(Consumer<E> afterSaveHandler) Sets the handler to be invoked when the detail view saves the entity (if "enable editing" action was executed).voidsetDialogWindowBuilders(DialogWindows dialogWindows) protected voidsetMessages(Messages messages) voidsetOpenMode(OpenMode openMode) Sets the view open mode.voidsetQueryParametersProvider(ViewOpeningAction.QueryParametersProvider queryParameters) Sets query parameters provider that returns query parameters that should be used in the URL.voidsetReadOnlyViewsSupport(ReadOnlyViewsSupport readOnlyViewsSupport) voidsetRouteParametersProvider(ViewOpeningAction.RouteParametersProvider routeParameters) Sets route parameters provider that returns route parameters that should be used in the route template.voidvoidsetTransformation(Function<E, E> transformation) Sets the function to transform the saved in the detail view entity (if "enable editing" action was executed) before setting it to the target data container.protected voidsetUiComponentProperties(UiComponentProperties uiComponentProperties) voidsetViewClass(Class<? extends View> viewClass) Sets the detail view id.<V extends View<?>>
 voidsetViewConfigurer(Consumer<V> viewConfigurer) Sets the view configurer.voidSets the detail view id.voidsetViewNavigators(ViewNavigators viewNavigators) <V extends View<?>>
 ReadAction<E>withAfterCloseHandler(Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) withAfterSavedHandler(Consumer<E> afterSavedHandler) withOpenMode(OpenMode openMode) withTransformation(Function<E, E> transformation) withViewClass(Class<? extends View> viewClass) <V extends View<?>>
 ReadAction<E>withViewConfigurer(Consumer<V> viewConfigurer) withViewId(String viewId) Methods inherited from class io.jmix.flowui.action.list.SecuredListDataComponentActiongetConstraintEntityOp, setAccessManager, setApplicationContext, setConstraintEntityOp, setMetadata, withConstraintEntityOpMethods inherited from class io.jmix.flowui.action.list.ListDataComponentActionactionPerform, attachSelectionListener, checkTarget, checkTargetItems, getTarget, onSelectionChange, setTarget, withEnabled, withEnabledByUiPermissions, withHandler, withIcon, withIcon, withShortcutCombination, withTarget, withText, withTitle, withVariant, withVisible, withVisibleByUiPermissionsMethods inherited from class io.jmix.flowui.action.SecuredBaseActionaddEnabledRule, isEnabledByRule, isEnabledByUiPermissions, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabledByUiPermissions, setVisibleByUiPermissionsMethods inherited from class io.jmix.flowui.kit.action.BaseActionaddActionPerformedListener, setEnabled, setEnabledInternal, setVisible, setVisibleInternalMethods inherited from class io.jmix.flowui.kit.action.AbstractActionaddPropertyChangeListener, firePropertyChange, getDescription, getEventBus, getIcon, getId, getShortcutCombination, getText, getVariant, hasListener, isEnabled, isVisible, setDescription, setIcon, setShortcutCombination, setVariantMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.flowui.kit.action.ActionactionPerform, addPropertyChangeListener, getDescription, getIcon, getId, getText, getVariant, isEnabled, isVisible, refreshState, setDescription, setEnabled, setIcon, setVariant, setVisibleMethods inherited from interface io.jmix.flowui.kit.component.HasShortcutCombinationgetShortcutCombination, setShortcutCombination
- 
Field Details- 
ID- See Also:
 
- 
dialogWindows
- 
readOnlyViewsSupport
- 
viewInitializer
- 
afterSaveHandler
- 
transformation
- 
textInitializedprotected boolean textInitialized
- 
openMode
 
- 
- 
Constructor Details- 
ReadActionpublic ReadAction()
- 
ReadAction
 
- 
- 
Method Details- 
initActionprotected void initAction()- Overrides:
- initActionin class- ListDataComponentAction<ReadAction<E>,- E> 
 
- 
getOpenModeDescription 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 interface- ViewOpeningAction
 
- 
setOpenModeDescription copied from interface:ViewOpeningActionSets the view open mode.- Specified by:
- setOpenModein interface- ViewOpeningAction
- Parameters:
- openMode- the open mode to set
 
- 
getViewIdReturns the detail view id if it was set bysetViewId(String)or in the view XML. Otherwise, returns null.- Specified by:
- getViewIdin interface- ViewOpeningAction
 
- 
setViewIdSets the detail view id.- Specified by:
- setViewIdin interface- ViewOpeningAction
- Parameters:
- viewId- the view id to set
 
- 
getViewClassReturns the detail view class if it was set bysetViewClass(Class)or in the view XML. Otherwise returns null.- Specified by:
- getViewClassin interface- ViewOpeningAction
 
- 
setViewClassSets the detail view id.- Specified by:
- setViewClassin interface- ViewOpeningAction
- Parameters:
- viewClass- the view class to set
 
- 
getRouteParametersProvider- Specified by:
- getRouteParametersProviderin interface- ViewOpeningAction
- Returns:
- route parameters or nullif not set
 
- 
setRouteParametersProviderpublic void setRouteParametersProvider(@Nullable ViewOpeningAction.RouteParametersProvider routeParameters) 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 interface- ViewOpeningAction
- Parameters:
- routeParameters- route parameters provider to set
- See Also:
- 
- Route
 
 
- 
getQueryParametersProvider- Specified by:
- getQueryParametersProviderin interface- ViewOpeningAction
- Returns:
- query parameters provider or nullif not set
 
- 
setQueryParametersProviderpublic void setQueryParametersProvider(@Nullable ViewOpeningAction.QueryParametersProvider queryParameters) 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 interface- ViewOpeningAction
- Parameters:
- queryParameters- query parameters provider to set
 
- 
setAfterCloseHandlerpublic <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 interface- ViewOpeningAction
- Type Parameters:
- V- view type
- Parameters:
- afterCloseHandler- handler to set
 
- 
getAfterCloseHandler- Specified by:
- getAfterCloseHandlerin interface- ViewOpeningAction
 
- 
setViewConfigurerDescription 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 interface- ViewOpeningAction
 
- 
getViewConfigurer- Specified by:
- getViewConfigurerin interface- ViewOpeningAction
 
- 
setAfterSaveHandlerSets the handler to be invoked when the detail view saves the entity (if "enable editing" action was executed).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.read", subject = "afterSaveHandler") protected void petsTableReadAfterSaveHandler(Pet entity) { System.out.println("Saved " + entity); }
- 
getAfterSaveHandler
- 
setTransformationSets the function to transform the saved in the detail view entity (if "enable editing" action was executed) before setting it to the target data container.Note that transformation function is invoked if the detail is opened in OpenMode.DIALOGmode.The preferred way to set the function is using a controller method annotated with Install, e.g.:@Install(to = "petsTable.read", subject = "transformation") protected Pet petsTableReadTransformation(Pet entity) { return doTransform(entity); }- Parameters:
- transformation- transformation function to set
 
- 
getTransformation
- 
setMessages
- 
setUiComponentProperties
- 
setDialogWindowBuilders
- 
setReadOnlyViewsSupport
- 
setText- Specified by:
- setTextin interface- Action
- Overrides:
- setTextin class- AbstractAction
 
- 
isPermittedprotected boolean isPermitted()- Overrides:
- isPermittedin class- SecuredListDataComponentAction<ReadAction<E>,- E> 
 
- 
isApplicableprotected boolean isApplicable()- Overrides:
- isApplicablein class- SecuredListDataComponentAction<ReadAction<E>,- E> 
 
- 
executepublic void execute()Executes the action.- Specified by:
- executein interface- ExecutableAction
 
- 
openDialog
- 
withViewId- See Also:
 
- 
withViewClass- See Also:
 
- 
withRouteParametersProviderpublic ReadAction<E> withRouteParametersProvider(@Nullable ViewOpeningAction.RouteParametersProvider provider) 
- 
withQueryParametersProviderpublic ReadAction<E> withQueryParametersProvider(@Nullable ViewOpeningAction.QueryParametersProvider provider) 
- 
withOpenMode- See Also:
 
- 
withAfterCloseHandlerpublic <V extends View<?>> ReadAction<E> withAfterCloseHandler(Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) - See Also:
 
- 
withViewConfigurer- See Also:
 
- 
withAfterSavedHandler- See Also:
 
- 
withTransformation- See Also:
 
 
-