Package io.jmix.flowui.action
Interface ViewOpeningAction
- All Superinterfaces:
Action
,HasShortcutCombination
- All Known Implementing Classes:
AddAction
,CreateAction
,EditAction
,EntityInspectorAddAction
,EntityInspectorCreateAction
,EntityInspectorEditAction
,EntityInspectorLookupAction
,EntityLookupAction
,EntityOpenAction
,EntityOpenCompositionAction
,LogicalFilterEditAction
,MultiValueSelectAction
,ReadAction
Interface to be implemented by actions that open a view.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static interface
-
Field Summary
Fields inherited from interface io.jmix.flowui.kit.action.Action
PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT_COMBINATION, PROP_TEXT, PROP_VARIANT, PROP_VISIBLE
-
Method Summary
Modifier and TypeMethodDescriptionReturns the view open mode if it was set bysetOpenMode(OpenMode)
or in the view XML, otherwise returnsnull
.Returns the view class if it was set bysetViewClass(Class)
or in the view XML, otherwise returnsnull
.Returns the view id if it was set bysetViewId(String)
or in the view XML, otherwise returnsnull
.<V extends View<?>>
voidsetAfterCloseHandler
(Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) Sets the handler to be invoked when the detail view closes.void
setOpenMode
(OpenMode openMode) Sets the view open mode.void
setQueryParametersProvider
(ViewOpeningAction.QueryParametersProvider queryParameters) Sets query parameters provider that returns query parameters that should be used in the URL.void
setRouteParametersProvider
(ViewOpeningAction.RouteParametersProvider routeParameters) Sets route parameters provider that returns route parameters that should be used in the route template.void
setViewClass
(Class<? extends View> viewClass) Sets the view class.void
Sets the view id.Methods inherited from interface io.jmix.flowui.kit.action.Action
actionPerform, addPropertyChangeListener, getDescription, getIcon, getId, getText, getVariant, isEnabled, isVisible, refreshState, setDescription, setEnabled, setIcon, setText, setVariant, setVisible
Methods inherited from interface io.jmix.flowui.kit.component.HasShortcutCombination
getShortcutCombination, setShortcutCombination
-
Method Details
-
getOpenMode
Returns the view open mode if it was set bysetOpenMode(OpenMode)
or in the view XML, otherwise returnsnull
. -
setOpenMode
Sets the view open mode.- Parameters:
openMode
- the open mode to set
-
getViewId
Returns the view id if it was set bysetViewId(String)
or in the view XML, otherwise returnsnull
. -
setViewId
Sets the view id.- Parameters:
viewId
- the view id to set
-
getViewClass
Returns the view class if it was set bysetViewClass(Class)
or in the view XML, otherwise returnsnull
. -
setViewClass
Sets the view class.- Parameters:
viewClass
- the view class to set
-
getRouteParametersProvider
- Returns:
- route parameters or
null
if not set
-
setRouteParametersProvider
void setRouteParametersProvider(@Nullable ViewOpeningAction.RouteParametersProvider routeParameters) Sets 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
.- Parameters:
routeParameters
- route parameters provider to set- See Also:
-
Route
-
getQueryParametersProvider
- Returns:
- query parameters provider or
null
if not set
-
setQueryParametersProvider
void setQueryParametersProvider(@Nullable ViewOpeningAction.QueryParametersProvider queryParameters) Sets 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
.- Parameters:
queryParameters
- query parameters provider to set
-
setAfterCloseHandler
<V extends View<?>> void setAfterCloseHandler(@Nullable Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler) Sets the handler to be invoked when the detail view closes.Note that handler is invoked if the detail is opened in
OpenMode.DIALOG
mode.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"); } }
- Type Parameters:
V
- view type- Parameters:
afterCloseHandler
- handler to set
-