Package io.jmix.ui.action
Interface Action.ScreenOpeningAction
- All Known Implementing Classes:
AbstractLookupAction
,AddAction
,CreateAction
,EditAction
,EntityLookupAction
,EntityOpenAction
,EntityOpenCompositionAction
,RelatedAction
,TagLookupAction
,ViewAction
- Enclosing interface:
- Action
public static interface Action.ScreenOpeningAction
Interface to be implemented by actions that open a screen.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the screen open mode if it was set bysetOpenMode(OpenMode)
or in the screen XML, otherwise returnsnull
.Returns the screen class if it was set bysetScreenClass(Class)
or in the screen XML, otherwise returnsnull
.Returns the screen id if it was set bysetScreenId(String)
or in the screen XML, otherwise returnsnull
.void
setAfterCloseHandler
(Consumer<Screen.AfterCloseEvent> afterCloseHandler) Sets the handler to be invoked when the editor screen closes.void
setOpenMode
(OpenMode openMode) Sets the screen open mode.void
setScreenClass
(Class<? extends Screen> screenClass) Sets the screen class.void
setScreenConfigurer
(Consumer<Screen> screenConfigurer) Sets the screen configurer.void
setScreenId
(String screenId) Sets the screen id.void
setScreenOptionsSupplier
(Supplier<ScreenOptions> screenOptionsSupplier) Sets the screen options supplier.
-
Method Details
-
getOpenMode
Returns the screen open mode if it was set bysetOpenMode(OpenMode)
or in the screen XML, otherwise returnsnull
. -
setOpenMode
Sets the screen open mode.- Parameters:
openMode
- the open mode to set
-
getScreenId
Returns the screen id if it was set bysetScreenId(String)
or in the screen XML, otherwise returnsnull
. -
setScreenId
Sets the screen id.- Parameters:
screenId
- the screen id to set
-
getScreenClass
Returns the screen class if it was set bysetScreenClass(Class)
or in the screen XML, otherwise returnsnull
. -
setScreenClass
Sets the screen class.- Parameters:
screenClass
- the screen class to set
-
setScreenOptionsSupplier
Sets the screen options supplier. The supplier providesScreenOptions
to the opened screen.The preferred way to set the supplier is using a controller method annotated with
Install
, e.g.:@Install(to = "petsTable.view", subject = "screenOptionsSupplier") protected ScreenOptions petsTableViewScreenOptionsSupplier() { return new MapScreenOptions(ParamsMap.of("someParameter", 10)); }
-
setScreenConfigurer
Sets the screen configurer. Use the configurer if you need to provide parameters to the opened screen through setters.The preferred way to set the configurer is using a controller method annotated with
Install
, e.g.:@Install(to = "petsTable.view", subject = "screenConfigurer") protected void petsTableViewScreenConfigurer(Screen editorScreen) { ((PetEdit) editorScreen).setSomeParameter(someValue); }
-
setAfterCloseHandler
Sets the handler to be invoked when the editor screen closes.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"); } }
-