Package io.jmix.ui.component
Interface ScreenFacet<S extends Screen>
- All Superinterfaces:
org.springframework.context.ApplicationContextAware
,org.springframework.beans.factory.Aware
,Facet
- All Known Subinterfaces:
EditorScreenFacet<E,
,S> LookupScreenFacet<E,
S>
- All Known Implementing Classes:
AbstractEntityAwareScreenFacet
,AbstractScreenFacet
,EditorScreenFacetImpl
,LookupScreenFacetImpl
,ScreenFacetImpl
@StudioFacet(xmlElement="screen",
caption="Screen",
description="Prepares and shows screens",
defaultProperty="screenId",
category="Facets",
icon="io/jmix/ui/icon/facet/screen.svg",
documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/facets/screen-facet.html")
public interface ScreenFacet<S extends Screen>
extends Facet, org.springframework.context.ApplicationContextAware
Prepares and shows screens.
-
Method Summary
Modifier and TypeMethodDescriptionAdds the givenConsumer
as screen after close event listener.Adds the givenConsumer
as screen after show event listener.create()
void
setActionTarget
(String actionId) Sets that screen should be shown when action with idactionId
is performed.void
setButtonTarget
(String buttonId) Sets that screen should be shown when button with idactionId
is clicked.void
setOpenMode
(OpenMode openMode) Sets screenOpenMode
.void
setOptionsProvider
(Supplier<ScreenOptions> optionsProvider) Sets the givenSupplier
as screen options provider.void
setProperties
(Collection<UiControllerProperty> properties) Sets properties that will be injected into opened screen via public setters.void
setScreenClass
(Class<S> screenClass) Sets class of screen to open.void
setScreenConfigurer
(Consumer<S> screenConfigurer) Sets the screen configurer.void
setScreenId
(String screenId) Sets the id of screen to open.show()
Shows and returns screen.Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
-
Method Details
-
setScreenId
Sets the id of screen to open.- Parameters:
screenId
- screen id
-
getScreenId
- Returns:
- screen id
-
setScreenClass
@StudioProperty(type=SCREEN_CLASS_NAME, typeParameter="S") void setScreenClass(@Nullable Class<S> screenClass) Sets class of screen to open.- Parameters:
screenClass
- screen class
-
getScreenClass
- Returns:
- class of screen to open
-
getOpenMode
OpenMode getOpenMode()- Returns:
- screen
OpenMode
-
setOpenMode
@StudioProperty(name="openMode", type=SCREEN_OPEN_MODE, defaultValue="NEW_TAB") void setOpenMode(OpenMode openMode) Sets screenOpenMode
.- Parameters:
openMode
- an open mode to set
-
setOptionsProvider
Sets the givenSupplier
as screen options provider.- Parameters:
optionsProvider
- screen options provider
-
getOptionsProvider
- Returns:
ScreenOptions
provider
-
getScreenConfigurer
- Returns:
- the screen configurer or
null
of not set
-
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 withInstall
, e.g.:@Install(to = "userBrowseFacet", subject = "screenConfigurer") private void userBrowseFacetScreenConfigurer(UserBrowse userBrowse) { userBrowse.setSomeParameter(someValue); }
- Parameters:
screenConfigurer
- the configurer to set.
-
setProperties
@StudioElementsGroup(caption="Properties", xmlElement="properties", icon="io/jmix/ui/icon/element/properties.svg") void setProperties(Collection<UiControllerProperty> properties) Sets properties that will be injected into opened screen via public setters.- Parameters:
properties
- screen properties
-
getProperties
- Returns:
- properties that will be injected into opened screen via public setters.
-
getActionTarget
- Returns:
- id of action that triggers screen
-
setActionTarget
@StudioProperty(name="onAction", type=COMPONENT_REF, options="io.jmix.ui.action.Action") void setActionTarget(@Nullable String actionId) Sets that screen should be shown when action with idactionId
is performed.- Parameters:
actionId
- action id
-
getButtonTarget
- Returns:
- id of button that triggers screen
-
setButtonTarget
@StudioProperty(name="onButton", type=COMPONENT_REF, options="io.jmix.ui.component.Button") void setButtonTarget(@Nullable String buttonId) Sets that screen should be shown when button with idactionId
is clicked.- Parameters:
buttonId
- button id
-
create
S create()- Returns:
- new screen instance
-
show
S show()Shows and returns screen. -
addAfterShowEventListener
Adds the givenConsumer
as screen after show event listener.- Parameters:
listener
- listener- Returns:
- after show event subscription
-
addAfterCloseEventListener
Adds the givenConsumer
as screen after close event listener.- Parameters:
listener
- listener- Returns:
- after close event subscription
-