@StudioFacet(xmlElement="screen", caption="Screen", description="Prepares and shows screens", defaultProperty="screenId", category="Facets", icon="icon/screen.svg", documentationURL="https://doc.cuba-platform.com/manual-%VERSION%/gui_ScreenFacet.html") public interface ScreenFacet<S extends Screen> extends Facet, BeanLocatorAware
Modifier and Type | Interface and Description |
---|---|
static class |
ScreenFacet.AfterCloseEvent
Event that is fired when screen is closed.
|
static class |
ScreenFacet.AfterShowEvent
Event that is fired after screen show.
|
Modifier and Type | Method and Description |
---|---|
Subscription |
addAfterCloseEventListener(java.util.function.Consumer<ScreenFacet.AfterCloseEvent> listener)
Adds the given
Consumer as screen after close event listener. |
Subscription |
addAfterShowEventListener(java.util.function.Consumer<ScreenFacet.AfterShowEvent> listener)
Adds the given
Consumer as screen after show event listener. |
S |
create() |
java.lang.String |
getActionTarget() |
java.lang.String |
getButtonTarget() |
Screens.LaunchMode |
getLaunchMode() |
java.util.function.Supplier<ScreenOptions> |
getOptionsProvider() |
java.util.Collection<UiControllerProperty> |
getProperties() |
java.lang.Class<S> |
getScreenClass() |
java.lang.String |
getScreenId() |
void |
setActionTarget(java.lang.String actionId)
Sets that screen should be shown when action with id
actionId is performed. |
void |
setButtonTarget(java.lang.String buttonId)
Sets that screen should be shown when button with id
actionId is clicked. |
void |
setLaunchMode(Screens.LaunchMode launchMode)
Sets screen
Screens.LaunchMode . |
void |
setOptionsProvider(java.util.function.Supplier<ScreenOptions> optionsProvider)
Sets the given
Supplier as screen options provider. |
void |
setProperties(java.util.Collection<UiControllerProperty> properties)
Sets properties that will be injected into opened screen via public setters.
|
void |
setScreenClass(java.lang.Class<S> screenClass)
Sets class of screen to open.
|
void |
setScreenId(java.lang.String screenId)
Sets the id of screen to open.
|
S |
show()
Shows and returns screen.
|
getId, getOwner, setId, setOwner
setBeanLocator
@StudioProperty(type=STRING) void setScreenId(java.lang.String screenId)
screenId
- screen idjava.lang.String getScreenId()
@StudioProperty(type=SCREEN_CLASS_NAME, typeParameter="S") void setScreenClass(java.lang.Class<S> screenClass)
screenClass
- screen classjava.lang.Class<S> getScreenClass()
@StudioProperty(name="openMode", type=SCREEN_OPEN_MODE, defaultValue="NEW_TAB") void setLaunchMode(Screens.LaunchMode launchMode)
Screens.LaunchMode
.launchMode
- launch modeScreens.LaunchMode getLaunchMode()
Screens.LaunchMode
void setOptionsProvider(java.util.function.Supplier<ScreenOptions> optionsProvider)
Supplier
as screen options provider.optionsProvider
- screen options providerjava.util.function.Supplier<ScreenOptions> getOptionsProvider()
ScreenOptions
provider@StudioElementsGroup(xmlElement="properties") void setProperties(java.util.Collection<UiControllerProperty> properties)
properties
- screen propertiesjava.util.Collection<UiControllerProperty> getProperties()
java.lang.String getActionTarget()
@StudioProperty(name="onAction", type=COMPONENT_REF, options="com.haulmont.cuba.gui.components.Action") void setActionTarget(java.lang.String actionId)
actionId
is performed.actionId
- action idjava.lang.String getButtonTarget()
@StudioProperty(name="onButton", type=COMPONENT_REF, options="com.haulmont.cuba.gui.components.Button") void setButtonTarget(java.lang.String buttonId)
actionId
is clicked.buttonId
- button idS create()
S show()
Subscription addAfterShowEventListener(java.util.function.Consumer<ScreenFacet.AfterShowEvent> listener)
Consumer
as screen after show event listener.listener
- listenerSubscription addAfterCloseEventListener(java.util.function.Consumer<ScreenFacet.AfterCloseEvent> listener)
Consumer
as screen after close event listener.listener
- listener